[llvm] r266746 - Enable ODR uniquing of DITypes in more places

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 08:48:31 PDT 2016


Author: tejohnson
Date: Tue Apr 19 10:48:30 2016
New Revision: 266746

URL: http://llvm.org/viewvc/llvm-project?rev=266746&view=rev
Log:
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

Modified:
    llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
    llvm/trunk/tools/opt/opt.cpp

Modified: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp?rev=266746&r1=266745&r2=266746&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp Tue Apr 19 10:48:30 2016
@@ -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;

Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=266746&r1=266745&r2=266746&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Tue Apr 19 10:48:30 2016
@@ -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);




More information about the llvm-commits mailing list