summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-04-30 02:22:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-04-30 02:22:09 +0000
commitb5b622a03c5136fa10d245dbe1f8f278ebd98d1b (patch)
treeca6abc37ad856a89fb4b1810b464ee787221e2af /clang
parent8b9663e8cc1773e18d2e4c4e30bcb210e7ff2198 (diff)
downloadbcm5719-llvm-b5b622a03c5136fa10d245dbe1f8f278ebd98d1b.tar.gz
bcm5719-llvm-b5b622a03c5136fa10d245dbe1f8f278ebd98d1b.zip
Drop non-cfi assembly support from clang.
After this patch clang will ignore -fdwarf2-cfi-asm and -ffno-dwarf2-cfi-asm and always print assembly that uses cfi directives. In llvm, MC itself supports cfi since the end of 2010 (support started in r119972, is reported in the 2.9 release notes). In binutils the support has been around for much longer. It looks like support started to be added in May 2003. It is available in 2.15 (31-Aug-2011, 2.14 is from 12-Jun-2003). llvm-svn: 207602
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Driver/Options.td4
-rw-r--r--clang/include/clang/Frontend/CodeGenOptions.def1
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp2
-rw-r--r--clang/lib/Driver/Tools.cpp16
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
-rw-r--r--clang/test/Driver/cfi.c9
-rw-r--r--clang/test/Driver/dwarf2-cfi-asm.c35
7 files changed, 2 insertions, 66 deletions
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index d6b22795e0e..8d2e36866b0 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -441,8 +441,8 @@ def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tr
HelpText<"Print a template comparison tree for differing templates">;
def fdollars_in_identifiers : Flag<["-"], "fdollars-in-identifiers">, Group<f_Group>,
HelpText<"Allow '$' in identifiers">, Flags<[CC1Option]>;
-def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<f_Group>;
-def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<f_Group>, Flags<[CC1Option]>;
+def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
+def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
def fdwarf_directory_asm : Flag<["-"], "fdwarf-directory-asm">, Group<f_Group>;
def fno_dwarf_directory_asm : Flag<["-"], "fno-dwarf-directory-asm">, Group<f_Group>, Flags<[CC1Option]>;
def felide_constructors : Flag<["-"], "felide-constructors">, Group<f_Group>;
diff --git a/clang/include/clang/Frontend/CodeGenOptions.def b/clang/include/clang/Frontend/CodeGenOptions.def
index 753b641abfb..89591853873 100644
--- a/clang/include/clang/Frontend/CodeGenOptions.def
+++ b/clang/include/clang/Frontend/CodeGenOptions.def
@@ -68,7 +68,6 @@ CODEGENOPT(LessPreciseFPMAD , 1, 0) ///< Enable less precise MAD instructions t
///< be generated.
CODEGENOPT(MergeAllConstants , 1, 1) ///< Merge identical constants.
CODEGENOPT(NoCommon , 1, 0) ///< Set when -fno-common or C++ is enabled.
-CODEGENOPT(NoDwarf2CFIAsm , 1, 0) ///< Set when -fno-dwarf2-cfi-asm is enabled.
CODEGENOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm is
///< enabled.
CODEGENOPT(NoExecStack , 1, 0) ///< Set when -Wa,--noexecstack is enabled.
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 2c388ef58e9..8d4f69afc35 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -503,8 +503,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
TM->setMCRelaxAll(true);
if (CodeGenOpts.SaveTempLabels)
TM->setMCSaveTempLabels(true);
- if (CodeGenOpts.NoDwarf2CFIAsm)
- TM->setMCUseCFI(false);
if (!CodeGenOpts.NoDwarfDirectoryAsm)
TM->setMCUseDwarfDirectory(true);
if (CodeGenOpts.NoExecStack)
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 1fbf585d697..04df926e56b 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -1733,19 +1733,6 @@ static bool ShouldDisableAutolink(const ArgList &Args,
Default);
}
-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.
- Default = TC.useIntegratedAs();
- }
- return !Args.hasFlag(options::OPT_fdwarf2_cfi_asm,
- options::OPT_fno_dwarf2_cfi_asm,
- Default);
-}
-
static bool ShouldDisableDwarfDirectory(const ArgList &Args,
const ToolChain &TC) {
bool UseDwarfDirectory = Args.hasFlag(options::OPT_fdwarf_directory_asm,
@@ -3138,9 +3125,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fno-gnu-keywords");
}
- if (ShouldDisableCFI(Args, getToolChain()))
- CmdArgs.push_back("-fno-dwarf2-cfi-asm");
-
if (ShouldDisableDwarfDirectory(Args, getToolChain()))
CmdArgs.push_back("-fno-dwarf-directory-asm");
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 4d0c01def12..9321f892815 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -399,7 +399,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.RelaxAll = Args.hasArg(OPT_mrelax_all);
Opts.OmitLeafFramePointer = Args.hasArg(OPT_momit_leaf_frame_pointer);
Opts.SaveTempLabels = Args.hasArg(OPT_msave_temp_labels);
- Opts.NoDwarf2CFIAsm = Args.hasArg(OPT_fno_dwarf2_cfi_asm);
Opts.NoDwarfDirectoryAsm = Args.hasArg(OPT_fno_dwarf_directory_asm);
Opts.SoftFloat = Args.hasArg(OPT_msoft_float);
Opts.StrictEnums = Args.hasArg(OPT_fstrict_enums);
diff --git a/clang/test/Driver/cfi.c b/clang/test/Driver/cfi.c
deleted file mode 100644
index c33d1904286..00000000000
--- a/clang/test/Driver/cfi.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %clang -target i386-apple-darwin10 \
-// RUN: -no-integrated-as -### %s 2>&1 | \
-// RUN: FileCheck --check-prefix=CHECK-DARWIN %s
-
-// RUN: %clang -target i386-pc-linux-gnu -static -### %s 2>&1 | \
-// RUN: FileCheck --check-prefix=CHECK-LINUX %s
-
-// CHECK-DARWIN: -fno-dwarf2-cfi-asm
-// CHECK-LINUX-NOT: -fno-dwarf2-cfi-asm
diff --git a/clang/test/Driver/dwarf2-cfi-asm.c b/clang/test/Driver/dwarf2-cfi-asm.c
deleted file mode 100644
index a5c4878703b..00000000000
--- a/clang/test/Driver/dwarf2-cfi-asm.c
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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
OpenPOWER on IntegriCloud