summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-04-19 15:48:30 +0000
committerTeresa Johnson <tejohnson@google.com>2016-04-19 15:48:30 +0000
commit07c7e25718be03f7282b14da2f1c87cb3ce3447d (patch)
tree0ff50d0f1f8789f4cecf8f98df9df0fffa453f9c
parentef2979af50770b862795a075e1f2a775c420fcfe (diff)
downloadbcm5719-llvm-07c7e25718be03f7282b14da2f1c87cb3ce3447d.tar.gz
bcm5719-llvm-07c7e25718be03f7282b14da2f1c87cb3ce3447d.zip
Enable ODR uniquing of DITypes in more places
Summary: This is a follow-on to apply Duncan's new DIType ODR uniquing from r266549 and r266713 in more places. Enable enableDebugTypeODRUniquing() for ThinLTO backends invoked via libLTO, similar to the way r266549 enabled this for ThinLTO backend threads launched from gold-plugin. Also enable enableDebugTypeODRUniquing in opt, similar to the way r266549 enabled this for llvm-link (on by default, can be disabled with new -disable-debug-info-type-map option), since we may perform ThinLTO importing from opt. Reviewers: dexonsmith, joker.eph Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19263 llvm-svn: 266746
-rw-r--r--llvm/lib/LTO/ThinLTOCodeGenerator.cpp1
-rw-r--r--llvm/tools/opt/opt.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index ab13ec821aa..271520e4dd3 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -575,6 +575,7 @@ void ThinLTOCodeGenerator::run() {
Pool.async([&](int count) {
LLVMContext Context;
Context.setDiscardValueNames(LTODiscardValueNames);
+ Context.enableDebugTypeODRUniquing();
auto ModuleIdentifier = ModuleBuffer.getBufferIdentifier();
DenseMap<GlobalValue::GUID, GlobalValue::LinkageTypes> ResolvedODR;
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 96dee1ba598..641735c2998 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -102,6 +102,10 @@ static cl::opt<bool>
VerifyEach("verify-each", cl::desc("Verify after each transform"));
static cl::opt<bool>
+ DisableDITypeMap("disable-debug-info-type-map",
+ cl::desc("Don't use a uniquing type map for debug info"));
+
+static cl::opt<bool>
StripDebug("strip-debug",
cl::desc("Strip debugger symbol info from translation unit"));
@@ -365,6 +369,8 @@ int main(int argc, char **argv) {
SMDiagnostic Err;
Context.setDiscardValueNames(DiscardValueNames);
+ if (!DisableDITypeMap)
+ Context.enableDebugTypeODRUniquing();
// Load the input module...
std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context);
OpenPOWER on IntegriCloud