Skip to content

Commit b5b622a

Browse files
committed
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
1 parent 8b9663e commit b5b622a

File tree

7 files changed

+2
-66
lines changed

7 files changed

+2
-66
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tr
441441
HelpText<"Print a template comparison tree for differing templates">;
442442
def fdollars_in_identifiers : Flag<["-"], "fdollars-in-identifiers">, Group<f_Group>,
443443
HelpText<"Allow '$' in identifiers">, Flags<[CC1Option]>;
444-
def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<f_Group>;
445-
def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<f_Group>, Flags<[CC1Option]>;
444+
def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
445+
def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
446446
def fdwarf_directory_asm : Flag<["-"], "fdwarf-directory-asm">, Group<f_Group>;
447447
def fno_dwarf_directory_asm : Flag<["-"], "fno-dwarf-directory-asm">, Group<f_Group>, Flags<[CC1Option]>;
448448
def felide_constructors : Flag<["-"], "felide-constructors">, Group<f_Group>;

clang/include/clang/Frontend/CodeGenOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ CODEGENOPT(LessPreciseFPMAD , 1, 0) ///< Enable less precise MAD instructions t
6868
///< be generated.
6969
CODEGENOPT(MergeAllConstants , 1, 1) ///< Merge identical constants.
7070
CODEGENOPT(NoCommon , 1, 0) ///< Set when -fno-common or C++ is enabled.
71-
CODEGENOPT(NoDwarf2CFIAsm , 1, 0) ///< Set when -fno-dwarf2-cfi-asm is enabled.
7271
CODEGENOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm is
7372
///< enabled.
7473
CODEGENOPT(NoExecStack , 1, 0) ///< Set when -Wa,--noexecstack is enabled.

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
503503
TM->setMCRelaxAll(true);
504504
if (CodeGenOpts.SaveTempLabels)
505505
TM->setMCSaveTempLabels(true);
506-
if (CodeGenOpts.NoDwarf2CFIAsm)
507-
TM->setMCUseCFI(false);
508506
if (!CodeGenOpts.NoDwarfDirectoryAsm)
509507
TM->setMCUseDwarfDirectory(true);
510508
if (CodeGenOpts.NoExecStack)

clang/lib/Driver/Tools.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,19 +1733,6 @@ static bool ShouldDisableAutolink(const ArgList &Args,
17331733
Default);
17341734
}
17351735

1736-
static bool ShouldDisableCFI(const ArgList &Args,
1737-
const ToolChain &TC) {
1738-
bool Default = true;
1739-
if (TC.getTriple().isOSDarwin()) {
1740-
// The native darwin assembler doesn't support cfi directives, so
1741-
// we disable them if we think the .s file will be passed to it.
1742-
Default = TC.useIntegratedAs();
1743-
}
1744-
return !Args.hasFlag(options::OPT_fdwarf2_cfi_asm,
1745-
options::OPT_fno_dwarf2_cfi_asm,
1746-
Default);
1747-
}
1748-
17491736
static bool ShouldDisableDwarfDirectory(const ArgList &Args,
17501737
const ToolChain &TC) {
17511738
bool UseDwarfDirectory = Args.hasFlag(options::OPT_fdwarf_directory_asm,
@@ -3138,9 +3125,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
31383125
CmdArgs.push_back("-fno-gnu-keywords");
31393126
}
31403127

3141-
if (ShouldDisableCFI(Args, getToolChain()))
3142-
CmdArgs.push_back("-fno-dwarf2-cfi-asm");
3143-
31443128
if (ShouldDisableDwarfDirectory(Args, getToolChain()))
31453129
CmdArgs.push_back("-fno-dwarf-directory-asm");
31463130

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
399399
Opts.RelaxAll = Args.hasArg(OPT_mrelax_all);
400400
Opts.OmitLeafFramePointer = Args.hasArg(OPT_momit_leaf_frame_pointer);
401401
Opts.SaveTempLabels = Args.hasArg(OPT_msave_temp_labels);
402-
Opts.NoDwarf2CFIAsm = Args.hasArg(OPT_fno_dwarf2_cfi_asm);
403402
Opts.NoDwarfDirectoryAsm = Args.hasArg(OPT_fno_dwarf_directory_asm);
404403
Opts.SoftFloat = Args.hasArg(OPT_msoft_float);
405404
Opts.StrictEnums = Args.hasArg(OPT_fstrict_enums);

clang/test/Driver/cfi.c

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang/test/Driver/dwarf2-cfi-asm.c

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)