From: Teresa Johnson Date: Wed, 20 Apr 2016 02:23:52 +0000 (+0000) Subject: Enable ODR uniquing of DITypes for ThinLTO backends X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf579820ee1713e8ce740871ee1965d3afa95afe;p=clang Enable ODR uniquing of DITypes for ThinLTO backends 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 --- diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index 9bdbacd63f..d280a3eaef 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/lib/CodeGen/CodeGenAction.cpp @@ -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) {