diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2013-11-22 21:34:35 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2013-11-22 21:34:35 +0000 |
commit | 374c2bb37e7bbc4585cd6b7cd525e2ba09d8d497 (patch) | |
tree | 2eeb0c4b8d930e4ac3bcbad4d927ee7256f4fc15 /clang/lib/CodeGen/CGCXX.cpp | |
parent | b39751bc9f6e130c584790f0bc5091fd37365c2b (diff) | |
download | bcm5719-llvm-374c2bb37e7bbc4585cd6b7cd525e2ba09d8d497.tar.gz bcm5719-llvm-374c2bb37e7bbc4585cd6b7cd525e2ba09d8d497.zip |
Adjust r194296 to not apply the alias replacement for externally
available always-inline functions. This breaks libc++'s locale
implementation. Code generation for this case should be fixed, but this
is a stop gap fix for clang 3.4.
llvm-svn: 195501
Diffstat (limited to 'clang/lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 22baa654084..cfb2d6291b8 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -140,7 +140,14 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl, // Instead of creating as alias to a linkonce_odr, replace all of the uses // of the aliassee. - if (llvm::GlobalValue::isDiscardableIfUnused(Linkage)) { + if (llvm::GlobalValue::isDiscardableIfUnused(Linkage) && + (TargetLinkage != llvm::GlobalValue::AvailableExternallyLinkage || + !TargetDecl.getDecl()->hasAttr<AlwaysInlineAttr>())) { + // FIXME: An extern template instanciation 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; } |