Author: tejohnson Date: Mon Nov 13 07:38:33 2017 New Revision: 318042 URL: http://llvm.org/viewvc/llvm-project?rev=318042&view=rev Log: [ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang
Recommit of r317951 and r317951 along with what I believe should fix the remaining buildbot failures - the target triple should be specified for both the ThinLTO pre-thinlink compile and backend (post-thinlink) compile to ensure it is consistent. Original description: The LTO Config field wasn't being set when invoking a ThinLTO backend via clang (i.e. for distributed builds). Added: cfe/trunk/test/CodeGen/thinlto-debug-pm.c Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=318042&r1=318041&r2=318042&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original) +++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Mon Nov 13 07:38:33 2017 @@ -1073,6 +1073,7 @@ static void runThinLTOBackend(ModuleSumm initTargetOptions(Conf.Options, CGOpts, TOpts, LOpts, HeaderOpts); Conf.SampleProfile = std::move(SampleProfile); Conf.UseNewPM = CGOpts.ExperimentalNewPassManager; + Conf.DebugPassManager = CGOpts.DebugPassManager; switch (Action) { case Backend_EmitNothing: Conf.PreCodeGenModuleHook = [](size_t Task, const Module &Mod) { Added: cfe/trunk/test/CodeGen/thinlto-debug-pm.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/thinlto-debug-pm.c?rev=318042&view=auto ============================================================================== --- cfe/trunk/test/CodeGen/thinlto-debug-pm.c (added) +++ cfe/trunk/test/CodeGen/thinlto-debug-pm.c Mon Nov 13 07:38:33 2017 @@ -0,0 +1,10 @@ +// Test to ensure -fdebug-pass-manager works when invoking the +// ThinLTO backend path with the new PM. +// REQUIRES: x86-registered-target +// RUN: %clang_cc1 -o %t.o -flto=thin -fexperimental-new-pass-manager -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s +// RUN: llvm-lto -thinlto -o %t %t.o +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -fexperimental-new-pass-manager 2>&1 | FileCheck %s +// CHECK: Running pass: + +void foo() { +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits