diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-11-01 05:42:23 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-11-01 05:42:23 +0000 |
commit | b9bd6fb3976684fdfc39dd77b15d231aa4fd352d (patch) | |
tree | db77d390031cdc55931e45610c3c2989ff9926ed /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | a0852d2be35e058e6329b3783cfdd50cd32f1740 (diff) | |
download | bcm5719-llvm-b9bd6fb3976684fdfc39dd77b15d231aa4fd352d.tar.gz bcm5719-llvm-b9bd6fb3976684fdfc39dd77b15d231aa4fd352d.zip |
CodeGen: Virtual dtor thunks shouldn't have this marked as 'returned'
The ARM ABI virtual destructor thunks cannot be marked as 'returned'
because they return undef.
llvm-svn: 221042
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index a9c5fb2613a..426237711ec 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -839,9 +839,9 @@ static void setLinkageAndVisibilityForGV(llvm::GlobalValue *GV, } } -void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, - llvm::Function *F, - bool IsIncompleteFunction) { +void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, + bool IsIncompleteFunction, + bool IsThunk) { if (unsigned IID = F->getIntrinsicID()) { // If this is an intrinsic function, set the function's attributes // to the intrinsic's attributes. @@ -858,7 +858,7 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, // Add the Returned attribute for "this", except for iOS 5 and earlier // where substantial code, including the libstdc++ dylib, was compiled with // GCC and does not actually return "this". - if (getCXXABI().HasThisReturn(GD) && + if (!IsThunk && getCXXABI().HasThisReturn(GD) && !(getTarget().getTriple().isiOS() && getTarget().getTriple().isOSVersionLT(6))) { assert(!F->arg_empty() && @@ -1493,7 +1493,7 @@ llvm::Constant * CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable, - bool DontDefer, + bool DontDefer, bool IsThunk, llvm::AttributeSet ExtraAttrs) { const Decl *D = GD.getDecl(); @@ -1535,7 +1535,7 @@ CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName, MangledName, &getModule()); assert(F->getName() == MangledName && "name was uniqued!"); if (D) - SetFunctionAttributes(GD, F, IsIncompleteFunction); + SetFunctionAttributes(GD, F, IsIncompleteFunction, IsThunk); if (ExtraAttrs.hasAttributes(llvm::AttributeSet::FunctionIndex)) { llvm::AttrBuilder B(ExtraAttrs, llvm::AttributeSet::FunctionIndex); F->addAttributes(llvm::AttributeSet::FunctionIndex, @@ -1629,7 +1629,7 @@ CodeGenModule::CreateRuntimeFunction(llvm::FunctionType *FTy, llvm::AttributeSet ExtraAttrs) { llvm::Constant *C = GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false, - /*DontDefer=*/false, ExtraAttrs); + /*DontDefer=*/false, /*IsThunk=*/false, ExtraAttrs); if (auto *F = dyn_cast<llvm::Function>(C)) if (F->empty()) F->setCallingConv(getRuntimeCC()); |