From bab175ec4b075c8076ba14c762900392533f6ee4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:08 +0000 Subject: Vendor import of clang trunk r290819: https://llvm.org/svn/llvm-project/cfe/trunk@290819 --- lib/CodeGen/CGException.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen/CGException.cpp') diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 4a7dc4205e09..7b7880e07a95 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -221,10 +221,9 @@ const EHPersonality &EHPersonality::get(CodeGenFunction &CGF) { static llvm::Constant *getPersonalityFn(CodeGenModule &CGM, const EHPersonality &Personality) { - llvm::Constant *Fn = - CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty, true), - Personality.PersonalityFn); - return Fn; + return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty, true), + Personality.PersonalityFn, + llvm::AttributeSet(), /*Local=*/true); } static llvm::Constant *getOpaquePersonalityFn(CodeGenModule &CGM, @@ -698,6 +697,10 @@ llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() { return nullptr; } + // CUDA device code doesn't have exceptions. + if (LO.CUDA && LO.CUDAIsDevice) + return nullptr; + // Check the innermost scope for a cached landing pad. If this is // a non-EH cleanup, we'll check enclosing scopes in EmitLandingPad. llvm::BasicBlock *LP = EHStack.begin()->getCachedLandingPad(); @@ -1429,7 +1432,8 @@ struct PerformSEHFinally final : EHScopeStack::Cleanup { const CGFunctionInfo &FnInfo = CGM.getTypes().arrangeBuiltinFunctionCall(Context.VoidTy, Args); - CGF.EmitCall(FnInfo, OutlinedFinally, ReturnValueSlot(), Args); + auto Callee = CGCallee::forDirect(OutlinedFinally); + CGF.EmitCall(FnInfo, Callee, ReturnValueSlot(), Args); } }; } // end anonymous namespace -- cgit v1.2.3