r201963 - clang: add -f{no-,}integrate-as as consistent parameters
Saleem Abdulrasool
compnerd at compnerd.org
Sat Feb 22 16:40:31 PST 2014
Author: compnerd
Date: Sat Feb 22 18:40:30 2014
New Revision: 201963
URL: http://llvm.org/viewvc/llvm-project?rev=201963&view=rev
Log:
clang: add -f{no-,}integrate-as as consistent parameters
The integrated assembler is a feature. This makes the new flags the default
option, and the previous versions aliases. Ideally, at some point the aliases
would be entirely removed.
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/ToolChain.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/test/Driver/integrated-as.c
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=201963&r1=201962&r2=201963&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Sat Feb 22 18:40:30 2014
@@ -947,7 +947,6 @@ def verify_pch : Flag<["-"], "verify-pch
HelpText<"Load and verify that a pre-compiled header file is not stale">;
def init : Separate<["-"], "init">;
def install__name : Separate<["-"], "install_name">;
-def integrated_as : Flag<["-"], "integrated-as">, Flags<[DriverOption]>;
def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>, Flags<[CC1Option]>,
HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"<dir>">;
def iquote : JoinedOrSeparate<["-"], "iquote">, Group<clang_i_Group>, Flags<[CC1Option]>,
@@ -1191,7 +1190,6 @@ def mwarn_nonportable_cfstrings : Flag<[
def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, Flags<[HelpHidden]>,
HelpText<"Use relative instead of canonical paths">;
def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>;
-def no_integrated_as : Flag<["-"], "no-integrated-as">, Flags<[CC1Option, DriverOption]>;
def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[DriverOption]>;
def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">;
@@ -1327,6 +1325,15 @@ def x : JoinedOrSeparate<["-"], "x">, Fl
MetaVarName<"<language>">;
def y : Joined<["-"], "y">;
+def fintegrated_as : Flag<["-"], "fintegrated-as">, Flags<[DriverOption]>,
+ Group<f_Group>, HelpText<"Enable the integrated assembler">;
+def fno_integrated_as : Flag<["-"], "fno-integrated-as">,
+ Flags<[CC1Option, DriverOption]>, Group<f_Group>,
+ HelpText<"Disable the integrated assembler">;
+def : Flag<["-"], "integrated-as">, Alias<fintegrated_as>, Flags<[DriverOption]>;
+def : Flag<["-"], "no-integrated-as">, Alias<fno_integrated_as>,
+ Flags<[CC1Option, DriverOption]>;
+
def working_directory : JoinedOrSeparate<["-"], "working-directory">, Flags<[CC1Option]>,
HelpText<"Resolve file paths relative to the specified directory">;
def working_directory_EQ : Joined<["-"], "working-directory=">, Flags<[CC1Option]>,
Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=201963&r1=201962&r2=201963&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Sat Feb 22 18:40:30 2014
@@ -38,8 +38,8 @@ const Driver &ToolChain::getDriver() con
}
bool ToolChain::useIntegratedAs() const {
- return Args.hasFlag(options::OPT_integrated_as,
- options::OPT_no_integrated_as,
+ return Args.hasFlag(options::OPT_fintegrated_as,
+ options::OPT_fno_integrated_as,
IsIntegratedAssemblerDefault());
}
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=201963&r1=201962&r2=201963&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Feb 22 18:40:30 2014
@@ -2521,7 +2521,7 @@ void Clang::ConstructJob(Compilation &C,
Args.hasArg(options::OPT_dA))
CmdArgs.push_back("-masm-verbose");
- if (!Args.hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as,
+ if (!Args.hasFlag(options::OPT_fintegrated_as, options::OPT_fno_integrated_as,
IsIntegratedAssemblerDefault))
CmdArgs.push_back("-no-integrated-as");
@@ -4904,12 +4904,12 @@ void darwin::Assemble::ConstructJob(Comp
SourceAction = SourceAction->getInputs()[0];
}
- // If -no_integrated_as is used add -Q to the darwin assember driver to make
+ // If -fno_integrated_as is used add -Q to the darwin assember driver to make
// sure it runs its system assembler not clang's integrated assembler.
// Applicable to darwin11+ and Xcode 4+. darwin<10 lacked integrated-as.
// FIXME: at run-time detect assembler capabilities or rely on version
// information forwarded by -target-assembler-version (future)
- if (Args.hasArg(options::OPT_no_integrated_as)) {
+ if (Args.hasArg(options::OPT_fno_integrated_as)) {
const llvm::Triple &T(getToolChain().getTriple());
if (!(T.isMacOSX() && T.isMacOSXVersionLT(10, 7)))
CmdArgs.push_back("-Q");
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=201963&r1=201962&r2=201963&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Sat Feb 22 18:40:30 2014
@@ -366,7 +366,7 @@ static bool ParseCodeGenArgs(CodeGenOpti
(Opts.OptimizationLevel > 1 && !Opts.OptimizeSize));
Opts.RerollLoops = Args.hasArg(OPT_freroll_loops);
- Opts.DisableIntegratedAS = Args.hasArg(OPT_no_integrated_as);
+ Opts.DisableIntegratedAS = Args.hasArg(OPT_fno_integrated_as);
Opts.Autolink = !Args.hasArg(OPT_fno_autolink);
Opts.SampleProfileFile = Args.getLastArgValue(OPT_fprofile_sample_use_EQ);
Opts.ProfileInstrGenerate = Args.hasArg(OPT_fprofile_instr_generate);
Modified: cfe/trunk/test/Driver/integrated-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/integrated-as.c?rev=201963&r1=201962&r2=201963&view=diff
==============================================================================
--- cfe/trunk/test/Driver/integrated-as.c (original)
+++ cfe/trunk/test/Driver/integrated-as.c Sat Feb 22 18:40:30 2014
@@ -3,6 +3,17 @@
// CHECK: cc1as
// CHECK: -mrelax-all
+// RUN: %clang -### -fintegrated-as -c -save-temps %s 2>&1 | FileCheck %s -check-prefix FIAS
+
+// FIAS: cc1as
+
+// RUN: %clang -### -fno-integrated-as -S %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix NOFIAS
+
+// NOFIAS-NOT: cc1as
+// NOFIAS: -cc1
+// NOFIAS: -no-integrated-as
+
// RUN: %clang -### -c -integrated-as -Wa,-compress-debug-sections -Wno-missing-debug-compression %s 2>&1 | FileCheck --check-prefix=COMPRESS_DEBUG_QUIET %s
// COMPRESS_DEBUG_QUIET-NOT: warning: DWARF compression is not implemented
// COMPRESS_DEBUG_QUIET-NOT: warning: argument unused during compilation
More information about the cfe-commits
mailing list