diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-09-14 21:35:16 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-09-14 21:35:16 +0000 |
commit | 6b2a61d3a5c1c1ac968e0593b8d9151207216882 (patch) | |
tree | d715507a835b34ed4913199e928408bf2d880758 /clang/lib/CodeGen/CGCXX.cpp | |
parent | ddc04ef4933dbb176fde074613508d5311d3c338 (diff) | |
download | bcm5719-llvm-6b2a61d3a5c1c1ac968e0593b8d9151207216882.tar.gz bcm5719-llvm-6b2a61d3a5c1c1ac968e0593b8d9151207216882.zip |
Revert "Always_inline codegen rewrite" and 2 follow-ups.
Revert "Update cxx-irgen.cpp test to allow signext in alwaysinline functions."
Revert "[CodeGen] Remove wrapper-free always_inline functions from COMDATs"
Revert "Always_inline codegen rewrite."
Reason for revert: PR24793.
llvm-svn: 247620
Diffstat (limited to 'clang/lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 592b74f1909..ea32e382705 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -109,9 +109,6 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) { D->getType()->getAs<FunctionType>()->getCallConv()) return true; - if (BaseD->hasAttr<AlwaysInlineAttr>()) - return true; - return TryEmitDefinitionAsAlias(GlobalDecl(D, Dtor_Base), GlobalDecl(BaseD, Dtor_Base), false); @@ -164,7 +161,14 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl, // Instead of creating as alias to a linkonce_odr, replace all of the uses // of the aliasee. - if (llvm::GlobalValue::isDiscardableIfUnused(Linkage)) { + if (llvm::GlobalValue::isDiscardableIfUnused(Linkage) && + (TargetLinkage != llvm::GlobalValue::AvailableExternallyLinkage || + !TargetDecl.getDecl()->hasAttr<AlwaysInlineAttr>())) { + // FIXME: An extern template instantiation will create functions with + // linkage "AvailableExternally". In libc++, some classes also define + // members with attribute "AlwaysInline" and expect no reference to + // be generated. It is desirable to reenable this optimisation after + // corresponding LLVM changes. Replacements[MangledName] = Aliasee; return false; } |