From 604f802fd30d60226fca7d808b7e513e7f80c603 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Fri, 19 Jul 2019 23:02:58 +0000 Subject: [LTO] Always mark regular LTO units with EnableSplitLTOUnit=1 Summary: Regular LTO modules do not need LTO Unit splitting, only ThinLTO does (they must be consistently split into regular and Thin units for optimizations such as whole program devirtualization and lower type tests). In order to avoid spurious errors from LTO when combining with split ThinLTO modules, always set this flag for regular LTO modules. Reviewers: pcc Subscribers: mehdi_amini, Prazek, inglorion, steven_wu, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65009 llvm-svn: 366623 --- clang/lib/CodeGen/BackendUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/BackendUtil.cpp') diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 850b3db6213..b53d7a6ddfa 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -852,7 +852,7 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action, if (!TheModule->getModuleFlag("ThinLTO")) TheModule->addModuleFlag(Module::Error, "ThinLTO", uint32_t(0)); TheModule->addModuleFlag(Module::Error, "EnableSplitLTOUnit", - CodeGenOpts.EnableSplitLTOUnit); + uint32_t(1)); } PerModulePasses.add(createBitcodeWriterPass( -- cgit v1.2.3