]> granicus.if.org Git - clang/commitdiff
[clang][NewPM] Fix split debug test
authorLeonard Chan <leonardchan@google.com>
Thu, 13 Jun 2019 17:40:03 +0000 (17:40 +0000)
committerLeonard Chan <leonardchan@google.com>
Thu, 13 Jun 2019 17:40:03 +0000 (17:40 +0000)
This contains the part of D62225 which fixes CodeGen/split-debug-single-file.c
by not placing .dwo sections when using -enable-split-dwarf=split.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363281 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp
test/CodeGen/split-debug-single-file.c

index ff4d3599fe751137b3aef51fc77eb7b5efa25ecd..53292bec5e2e2d973bbb4ad8700718d708a5a086 100644 (file)
@@ -1275,7 +1275,8 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
     NeedCodeGen = true;
     CodeGenPasses.add(
         createTargetTransformInfoWrapperPass(getTargetIRAnalysis()));
-    if (!CodeGenOpts.SplitDwarfFile.empty()) {
+    if (!CodeGenOpts.SplitDwarfFile.empty() &&
+        CodeGenOpts.getSplitDwarfMode() == CodeGenOptions::SplitFileFission) {
       DwoOS = openOutputFile(CodeGenOpts.SplitDwarfFile);
       if (!DwoOS)
         return;
index 5987dc07ab891ccdbc49790e84c86895cc9bdefe..1c775d09411cac122685a2d3147966147c4f436c 100644 (file)
@@ -2,13 +2,19 @@
 
 // Testing to ensure -enable-split-dwarf=single allows to place .dwo sections into regular output object.
 //  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
-//  RUN:   -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s
+//  RUN:   -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
+//  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SINGLE %s
+//  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
+//  RUN:   -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s -fexperimental-new-pass-manager
 //  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SINGLE %s
 //  MODE-SINGLE: .dwo
 
 // Testing to ensure -enable-split-dwarf=split does not place .dwo sections into regular output object.
 //  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
-//  RUN:   -enable-split-dwarf=split -split-dwarf-file %t.o -emit-obj -o %t.o %s
+//  RUN:   -enable-split-dwarf=split -split-dwarf-file %t.o -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
+//  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SPLIT %s
+//  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
+//  RUN:   -enable-split-dwarf=split -split-dwarf-file %t.o -emit-obj -o %t.o %s -fexperimental-new-pass-manager
 //  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SPLIT %s
 //  MODE-SPLIT-NOT: .dwo