[cfe-commits] r152316 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/dwarf2-cfi-asm.c
Rafael Espindola
rafael.espindola at gmail.com
Thu Mar 8 06:39:56 PST 2012
Author: rafael
Date: Thu Mar 8 08:39:55 2012
New Revision: 152316
URL: http://llvm.org/viewvc/llvm-project?rev=152316&view=rev
Log:
Implement -fno-dwarf2-cfi-asm on linux too.
Added:
cfe/trunk/test/Driver/dwarf2-cfi-asm.c
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=152316&r1=152315&r2=152316&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Mar 8 08:39:55 2012
@@ -1117,20 +1117,17 @@
static bool ShouldDisableCFI(const ArgList &Args,
const ToolChain &TC) {
+ bool Default = true;
if (TC.getTriple().isOSDarwin()) {
// The native darwin assembler doesn't support cfi directives, so
// we disable them if we think the .s file will be passed to it.
- bool UseIntegratedAs = Args.hasFlag(options::OPT_integrated_as,
- options::OPT_no_integrated_as,
- TC.IsIntegratedAssemblerDefault());
- bool UseCFI = Args.hasFlag(options::OPT_fdwarf2_cfi_asm,
- options::OPT_fno_dwarf2_cfi_asm,
- UseIntegratedAs);
- return !UseCFI;
- }
-
- // For now we assume that every other assembler support CFI.
- return false;
+ Default = Args.hasFlag(options::OPT_integrated_as,
+ options::OPT_no_integrated_as,
+ TC.IsIntegratedAssemblerDefault());
+ }
+ return !Args.hasFlag(options::OPT_fdwarf2_cfi_asm,
+ options::OPT_fno_dwarf2_cfi_asm,
+ Default);
}
static bool ShouldDisableDwarfDirectory(const ArgList &Args,
Added: cfe/trunk/test/Driver/dwarf2-cfi-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/dwarf2-cfi-asm.c?rev=152316&view=auto
==============================================================================
--- cfe/trunk/test/Driver/dwarf2-cfi-asm.c (added)
+++ cfe/trunk/test/Driver/dwarf2-cfi-asm.c Thu Mar 8 08:39:55 2012
@@ -0,0 +1,35 @@
+// RUN: %clang -target x86_64-apple-darwin -### -S -integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-MC-DEFAULT %s
+// RUN: %clang -target x86_64-apple-darwin -### -S -integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-MC-CFI %s
+// RUN: %clang -target x86_64-apple-darwin -### -S -integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-MC-NOCFI %s
+
+// RUN: %clang -target x86_64-apple-darwin -### -S -no-integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-AS-DEFAULT %s
+// RUN: %clang -target x86_64-apple-darwin -### -S -no-integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-AS-CFI %s
+// RUN: %clang -target x86_64-apple-darwin -### -S -no-integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-AS-NOCFI %s
+
+
+// RUN: %clang -target x86_64-pc-linux -### -S -integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-MC-DEFAULT %s
+// RUN: %clang -target x86_64-pc-linux -### -S -integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-MC-CFI %s
+// RUN: %clang -target x86_64-pc-linux -### -S -integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-MC-NOCFI %s
+
+// RUN: %clang -target x86_64-pc-linux -### -S -no-integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-AS-DEFAULT %s
+// RUN: %clang -target x86_64-pc-linux -### -S -no-integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-AS-CFI %s
+// RUN: %clang -target x86_64-pc-linux -### -S -no-integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-AS-NOCFI %s
+
+
+
+// CHECK-DARWIN-MC-DEFAULT-NOT: -fno-dwarf2-cfi-asm
+// CHECK-DARWIN-MC-CFI-NOT: -fno-dwarf2-cfi-asm
+// CHECK-DARWIN-MC-NOCFI: -fno-dwarf2-cfi-asm
+
+// CHECK-DARWIN-AS-DEFAULT: -fno-dwarf2-cfi-asm
+// CHECK-DARWIN-AS-CFI-NOT: -fno-dwarf2-cfi-asm
+// CHECK-DARWIN-AS-NOCFI: -fno-dwarf2-cfi-asm
+
+
+// CHECK-LINUX-MC-DEFAULT-NOT: -fno-dwarf2-cfi-asmx
+// CHECK-LINUX-MC-CFI-NOT: -fno-dwarf2-cfi-asm
+// CHECK-LINUX-MC-NOCFI: -fno-dwarf2-cfi-asm
+
+// CHECK-LINUX-AS-DEFAULT-NOT: -fno-dwarf2-cfi-asm
+// CHECK-LINUX-AS-CFI-NOT: -fno-dwarf2-cfi-asm
+// CHECK-LINUX-AS-NOCFI: -fno-dwarf2-cfi-asm
More information about the cfe-commits
mailing list