summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVTT.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2015-05-08 16:47:21 +0000
committerDerek Schuff <dschuff@google.com>2015-05-08 16:47:21 +0000
commit2312bd38114c932374f37aa4fe6c8fefc763dbfb (patch)
treea35e7f252d2bda095536bdf987bbaadc0188809c /clang/lib/CodeGen/CGVTT.cpp
parent049887b252f7f7cca78ade06f03075f0df8d247c (diff)
downloadbcm5719-llvm-2312bd38114c932374f37aa4fe6c8fefc763dbfb.tar.gz
bcm5719-llvm-2312bd38114c932374f37aa4fe6c8fefc763dbfb.zip
Do not emit thunks with available_externally linkage in comdats
Functions with available_externally linkage will not be emitted to object files (they will just be undefined symbols), so it does not make sense to put them in comdats. Creates a second overload of maybeSetTrivialComdat that uses the GlobalObject instead of the Decl, and uses that in several places that had the faulty logic. Differential Revision: http://reviews.llvm.org/D9580 llvm-svn: 236879
Diffstat (limited to 'clang/lib/CodeGen/CGVTT.cpp')
-rw-r--r--clang/lib/CodeGen/CGVTT.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGVTT.cpp b/clang/lib/CodeGen/CGVTT.cpp
index 895afd75afc..aca9e7a3e62 100644
--- a/clang/lib/CodeGen/CGVTT.cpp
+++ b/clang/lib/CodeGen/CGVTT.cpp
@@ -94,8 +94,7 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
// Set the correct linkage.
VTT->setLinkage(Linkage);
- if (CGM.supportsCOMDAT() && VTT->isWeakForLinker())
- VTT->setComdat(CGM.getModule().getOrInsertComdat(VTT->getName()));
+ CGM.maybeSetTrivialComdat(*VTT);
// Set the right visibility.
CGM.setGlobalVisibility(VTT, RD);
@@ -177,4 +176,3 @@ CodeGenVTables::getSecondaryVirtualPointerIndex(const CXXRecordDecl *RD,
return I->second;
}
-
OpenPOWER on IntegriCloud