diff options
Diffstat (limited to 'lib/Transforms/Utils/EscapeEnumerator.cpp')
-rw-r--r-- | lib/Transforms/Utils/EscapeEnumerator.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Transforms/Utils/EscapeEnumerator.cpp b/lib/Transforms/Utils/EscapeEnumerator.cpp index 762a374c135c..914babeb6829 100644 --- a/lib/Transforms/Utils/EscapeEnumerator.cpp +++ b/lib/Transforms/Utils/EscapeEnumerator.cpp @@ -1,9 +1,8 @@ //===- EscapeEnumerator.cpp -----------------------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -19,7 +18,7 @@ #include "llvm/IR/Module.h" using namespace llvm; -static Constant *getDefaultPersonalityFn(Module *M) { +static FunctionCallee getDefaultPersonalityFn(Module *M) { LLVMContext &C = M->getContext(); Triple T(M->getTargetTriple()); EHPersonality Pers = getDefaultEHPersonality(T); @@ -69,8 +68,8 @@ IRBuilder<> *EscapeEnumerator::Next() { BasicBlock *CleanupBB = BasicBlock::Create(C, CleanupBBName, &F); Type *ExnTy = StructType::get(Type::getInt8PtrTy(C), Type::getInt32Ty(C)); if (!F.hasPersonalityFn()) { - Constant *PersFn = getDefaultPersonalityFn(F.getParent()); - F.setPersonalityFn(PersFn); + FunctionCallee PersFn = getDefaultPersonalityFn(F.getParent()); + F.setPersonalityFn(cast<Constant>(PersFn.getCallee())); } if (isScopedEHPersonality(classifyEHPersonality(F.getPersonalityFn()))) { |