Index: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp =================================================================== --- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp +++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp @@ -575,6 +575,7 @@ Pool.async([&](int count) { LLVMContext Context; Context.setDiscardValueNames(LTODiscardValueNames); + Context.enableDebugTypeODRUniquing(); auto ModuleIdentifier = ModuleBuffer.getBufferIdentifier(); DenseMap ResolvedODR; Index: llvm/trunk/tools/opt/opt.cpp =================================================================== --- llvm/trunk/tools/opt/opt.cpp +++ llvm/trunk/tools/opt/opt.cpp @@ -102,6 +102,10 @@ VerifyEach("verify-each", cl::desc("Verify after each transform")); static cl::opt + DisableDITypeMap("disable-debug-info-type-map", + cl::desc("Don't use a uniquing type map for debug info")); + +static cl::opt StripDebug("strip-debug", cl::desc("Strip debugger symbol info from translation unit")); @@ -365,6 +369,8 @@ SMDiagnostic Err; Context.setDiscardValueNames(DiscardValueNames); + if (!DisableDITypeMap) + Context.enableDebugTypeODRUniquing(); // Load the input module... std::unique_ptr M = parseIRFile(InputFilename, Err, Context);