]> granicus.if.org Git - clang/commitdiff
Enable ODR uniquing of DITypes for ThinLTO backends
authorTeresa Johnson <tejohnson@google.com>
Wed, 20 Apr 2016 02:23:52 +0000 (02:23 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 20 Apr 2016 02:23:52 +0000 (02:23 +0000)
Summary:
This is a follow-on to apply Duncan's new DIType ODR uniquing from
r266549 and r266713 in more places.

When invoking ThinLTO backend compiles via clang (for a distributed
build), invoke enableDebugTypeODRUniquing() before parsing the module.

Reviewers: dexonsmith, joker.eph

Subscribers: llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D19264

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266852 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenAction.cpp

index 9bdbacd63f6240f32488bd9b5515c1606668d8ef..d280a3eaef13a83b0c7a1c9dda4283b3a5d50a6e 100644 (file)
@@ -794,6 +794,11 @@ void CodeGenAction::ExecuteAction() {
     if (Invalid)
       return;
 
+    // For ThinLTO backend invocations, ensure that the context
+    // merges types based on ODR identifiers.
+    if (!CI.getCodeGenOpts().ThinLTOIndexFile.empty())
+      VMContext->enableDebugTypeODRUniquing();
+
     llvm::SMDiagnostic Err;
     TheModule = parseIR(MainFile->getMemBufferRef(), Err, *VMContext);
     if (!TheModule) {