r207602 - Drop non-cfi assembly support from clang.

Rafael Espindola rafael.espindola at gmail.com
Tue Apr 29 19:22:10 PDT 2014


Author: rafael
Date: Tue Apr 29 21:22:09 2014
New Revision: 207602

URL: http://llvm.org/viewvc/llvm-project?rev=207602&view=rev
Log:
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).

Removed:
    cfe/trunk/test/Driver/cfi.c
    cfe/trunk/test/Driver/dwarf2-cfi-asm.c
Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/include/clang/Frontend/CodeGenOptions.def
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=207602&r1=207601&r2=207602&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Tue Apr 29 21:22:09 2014
@@ -441,8 +441,8 @@ def fdiagnostics_show_template_tree : Fl
     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>;

Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=207602&r1=207601&r2=207602&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Tue Apr 29 21:22:09 2014
@@ -68,7 +68,6 @@ CODEGENOPT(LessPreciseFPMAD  , 1, 0) ///
                                      ///< 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.

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=207602&r1=207601&r2=207602&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Tue Apr 29 21:22:09 2014
@@ -503,8 +503,6 @@ TargetMachine *EmitAssemblyHelper::Creat
     TM->setMCRelaxAll(true);
   if (CodeGenOpts.SaveTempLabels)
     TM->setMCSaveTempLabels(true);
-  if (CodeGenOpts.NoDwarf2CFIAsm)
-    TM->setMCUseCFI(false);
   if (!CodeGenOpts.NoDwarfDirectoryAsm)
     TM->setMCUseDwarfDirectory(true);
   if (CodeGenOpts.NoExecStack)

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=207602&r1=207601&r2=207602&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Apr 29 21:22:09 2014
@@ -1733,19 +1733,6 @@ static bool ShouldDisableAutolink(const
                        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,
       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");
 

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=207602&r1=207601&r2=207602&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Apr 29 21:22:09 2014
@@ -399,7 +399,6 @@ static bool ParseCodeGenArgs(CodeGenOpti
   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);

Removed: cfe/trunk/test/Driver/cfi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cfi.c?rev=207601&view=auto
==============================================================================
--- cfe/trunk/test/Driver/cfi.c (original)
+++ cfe/trunk/test/Driver/cfi.c (removed)
@@ -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

Removed: cfe/trunk/test/Driver/dwarf2-cfi-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/dwarf2-cfi-asm.c?rev=207601&view=auto
==============================================================================
--- cfe/trunk/test/Driver/dwarf2-cfi-asm.c (original)
+++ cfe/trunk/test/Driver/dwarf2-cfi-asm.c (removed)
@@ -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





More information about the cfe-commits mailing list