r317951 - [ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang

Teresa Johnson via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 10 15:37:40 PST 2017


Author: tejohnson
Date: Fri Nov 10 15:37:39 2017
New Revision: 317951

URL: http://llvm.org/viewvc/llvm-project?rev=317951&view=rev
Log:
[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang

Summary:
The LTO Config field wasn't being set when invoking a ThinLTO backend
via clang (i.e. for distributed builds).

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

Differential Revision: https://reviews.llvm.org/D39923

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=317951&r1=317950&r2=317951&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Nov 10 15:37:39 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=317951&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/thinlto-debug-pm.c (added)
+++ cfe/trunk/test/CodeGen/thinlto-debug-pm.c Fri Nov 10 15:37:39 2017
@@ -0,0 +1,9 @@
+// Test to ensure -fdebug-pass-manager works when invoking the
+// ThinLTO backend path with the new PM.
+// RUN: %clang -O2 %s -flto=thin -c -o %t.o
+// 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() {
+}




More information about the cfe-commits mailing list