]> granicus.if.org Git - clang/commitdiff
Drop non-cfi assembly support from clang.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 30 Apr 2014 02:22:09 +0000 (02:22 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 30 Apr 2014 02:22:09 +0000 (02:22 +0000)
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).

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

include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.def
lib/CodeGen/BackendUtil.cpp
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp
test/Driver/cfi.c [deleted file]
test/Driver/dwarf2-cfi-asm.c [deleted file]

index d6b22795e0eaca7e0df2a6e0b92719acfaadded9..8d2e36866b083741964f8866ca138a83b334f181 100644 (file)
@@ -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>;
index 753b641abfbed6d275b3c860c0a2f0b404870949..89591853873387377d6503ee35aff14286ba3a50 100644 (file)
@@ -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.
index 2c388ef58e90a46894709b521ba46b853d13394c..8d4f69afc3546e16d9ccfa68e508d305a39fe667 100644 (file)
@@ -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)
index 1fbf585d697326fa9eb3fcf94c035de79d310851..04df926e56b294e2693bce989402a1295973b02e 100644 (file)
@@ -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");
 
index 4d0c01def128e4623ef95a6f2886c9736f002479..9321f892815b51513ce10b6133276507783924fb 100644 (file)
@@ -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/test/Driver/cfi.c b/test/Driver/cfi.c
deleted file mode 100644 (file)
index c33d190..0000000
+++ /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/test/Driver/dwarf2-cfi-asm.c b/test/Driver/dwarf2-cfi-asm.c
deleted file mode 100644 (file)
index a5c4878..0000000
+++ /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