[PATCH] D39923: [ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rL317951: [ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang (authored by tejohnson).

Repository:
  rL LLVM

https://reviews.llvm.org/D39923

Files:
  cfe/trunk/lib/CodeGen/BackendUtil.cpp
  cfe/trunk/test/CodeGen/thinlto-debug-pm.c


Index: cfe/trunk/lib/CodeGen/BackendUtil.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp
@@ -1073,6 +1073,7 @@
   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) {
Index: cfe/trunk/test/CodeGen/thinlto-debug-pm.c
===================================================================
--- cfe/trunk/test/CodeGen/thinlto-debug-pm.c
+++ cfe/trunk/test/CodeGen/thinlto-debug-pm.c
@@ -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() {
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39923.122544.patch
Type: text/x-patch
Size: 1213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171110/0a75796a/attachment.bin>


More information about the cfe-commits mailing list