]> granicus.if.org Git - clang/commitdiff
Implement -fno-dwarf2-cfi-asm.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 30 Apr 2011 18:35:43 +0000 (18:35 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 30 Apr 2011 18:35:43 +0000 (18:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130616 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.h
lib/CodeGen/BackendUtil.cpp
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp

index 55d061bb1ff5ff4b9d589085aae35ea9913a0df5..d243bf989fda7544f97f0fdee3bef0e26d3d916f 100644 (file)
@@ -113,6 +113,7 @@ def dwarf_debug_flags : Separate<"-dwarf-debug-flags">,
 def fforbid_guard_variables : Flag<"-fforbid-guard-variables">,
   HelpText<"Emit an error if a C++ static local initializer would need a guard variable">;
 def g : Flag<"-g">, HelpText<"Generate source level debug information">;
+def fno_dwarf2_cfi_asm : Flag<"-fno-dwarf2-cfi-asm">, HelpText<"Don't use the cfi directives">;
 def fcatch_undefined_behavior : Flag<"-fcatch-undefined-behavior">,
     HelpText<"Generate runtime checks for undefined behavior.">;
 def flimit_debug_info : Flag<"-flimit-debug-info">,
index 96e1c548138f185465a18f6a04b019c33080a20e..38f0c57af73ee116d00fa44599399cc9bff7429c 100644 (file)
@@ -280,6 +280,8 @@ def fdiagnostics_show_name : Flag<"-fdiagnostics-show-name">, Group<f_Group>;
 def fdiagnostics_show_note_include_stack : Flag<"-fdiagnostics-show-note-include-stack">, Group<f_Group>;
 def fdiagnostics_show_category_EQ : Joined<"-fdiagnostics-show-category=">, Group<f_clang_Group>;
 def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">, Group<f_Group>;
+def fdwarf2_cfi_asm : Flag<"-fdwarf2-cfi-asm">, Group<f_Group>;
+def fno_dwarf2_cfi_asm : Flag<"-fno-dwarf2-cfi-asm">, Group<f_Group>;
 def felide_constructors : Flag<"-felide-constructors">, Group<f_Group>;
 def feliminate_unused_debug_symbols : Flag<"-feliminate-unused-debug-symbols">, Group<f_Group>;
 def femit_all_decls : Flag<"-femit-all-decls">, Group<f_Group>;
index 4e17bdce0f25fc385d8b4cb5c810670a69996ca0..8bef6a3e0d43ab95ba93694de0837a2b1a51148e 100644 (file)
@@ -68,6 +68,7 @@ public:
                                   /// generated.
   unsigned MergeAllConstants : 1; /// Merge identical constants.
   unsigned NoCommon          : 1; /// Set when -fno-common or C++ is enabled.
+  unsigned NoDwarf2CFIAsm    : 1; /// Set when -fno-dwarf2-cfi-asm is enabled.
   unsigned NoImplicitFloat   : 1; /// Set when -mno-implicit-float is enabled.
   unsigned NoInfsFPMath      : 1; /// Assume FP arguments, results not +-Inf.
   unsigned NoNaNsFPMath      : 1; /// Assume FP arguments, results not NaN.
@@ -148,6 +149,7 @@ public:
     LessPreciseFPMAD = 0;
     MergeAllConstants = 1;
     NoCommon = 0;
+    NoDwarf2CFIAsm = 0;
     NoImplicitFloat = 0;
     NoInfsFPMath = 0;
     NoNaNsFPMath = 0;
index 497ccc54eef560a42763d1894bafb42412a3e28d..1264473dabcede57be7f9a332fe67de5861bf3b7 100644 (file)
@@ -280,6 +280,8 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
     TM->setMCRelaxAll(true);
   if (CodeGenOpts.SaveTempLabels)
     TM->setMCSaveTempLabels(true);
+  if (CodeGenOpts.NoDwarf2CFIAsm)
+    TM->setMCUseCFI(false);
 
   // Create the code generator passes.
   PassManager *PM = getCodeGenPasses();
index 2c805923c526e6966b88d1c50b648f36d676e778..099a9a1c479f64637b218d71ab233ecfa350d919 100644 (file)
@@ -1375,6 +1375,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("-fno-gnu-keywords");
   }
 
+  if (Arg *A = Args.getLastArg(options::OPT_fdwarf2_cfi_asm,
+                               options::OPT_fno_dwarf2_cfi_asm)) {
+    if (A->getOption().matches(options::OPT_fno_dwarf2_cfi_asm))
+      CmdArgs.push_back("-fno-dwarf2-cfi-asm");
+  }
+
   if (Arg *A = Args.getLastArg(options::OPT_ftemplate_depth_)) {
     CmdArgs.push_back("-ftemplate-depth");
     CmdArgs.push_back(A->getValue(Args));
index 21a80fee71cd736a3f5d4f5f508e4922b894cc35..1d4cd15ac4804e50b71c7c911e82bc7bf7bb137f 100644 (file)
@@ -203,6 +203,8 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts,
     Res.push_back("-mrelax-all");
   if (Opts.SaveTempLabels)
     Res.push_back("-msave-temp-labels");
+  if (Opts.NoDwarf2CFIAsm)
+    Res.push_back("-fno-dwarf2-cfi-asm");
   if (Opts.SoftFloat)
     Res.push_back("-msoft-float");
   if (Opts.UnwindTables)
@@ -955,6 +957,7 @@ static void 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.SoftFloat = Args.hasArg(OPT_msoft_float);
   Opts.UnsafeFPMath = Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
                       Args.hasArg(OPT_cl_fast_relaxed_math);