r201952 - clang: forward -no-integrated-as from the driver
Saleem Abdulrasool
compnerd at compnerd.org
Sat Feb 22 13:50:09 PST 2014
Author: compnerd
Date: Sat Feb 22 15:50:09 2014
New Revision: 201952
URL: http://llvm.org/viewvc/llvm-project?rev=201952&view=rev
Log:
clang: forward -no-integrated-as from the driver
Forward the -no-integrated-as option to -cc1 rather than simply invoking the
appropriate tool. This is useful since this option has been overloaded to
permit disabling of parsing inline assembly at the MC layer.
Added:
cfe/trunk/test/Driver/no-integrated-as.c
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=201952&r1=201951&r2=201952&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Feb 22 15:50:09 2014
@@ -2514,12 +2514,17 @@ void Clang::ConstructJob(Compilation &C,
// Decide whether to use verbose asm. Verbose assembly is the default on
// toolchains which have the integrated assembler on by default.
- bool IsVerboseAsmDefault = getToolChain().IsIntegratedAssemblerDefault();
+ bool IsIntegratedAssemblerDefault =
+ getToolChain().IsIntegratedAssemblerDefault();
if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm,
- IsVerboseAsmDefault) ||
+ IsIntegratedAssemblerDefault) ||
Args.hasArg(options::OPT_dA))
CmdArgs.push_back("-masm-verbose");
+ if (!Args.hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as,
+ IsIntegratedAssemblerDefault))
+ CmdArgs.push_back("-no-integrated-as");
+
if (Args.hasArg(options::OPT_fdebug_pass_structure)) {
CmdArgs.push_back("-mdebug-pass");
CmdArgs.push_back("Structure");
Added: cfe/trunk/test/Driver/no-integrated-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/no-integrated-as.c?rev=201952&view=auto
==============================================================================
--- cfe/trunk/test/Driver/no-integrated-as.c (added)
+++ cfe/trunk/test/Driver/no-integrated-as.c Sat Feb 22 15:50:09 2014
@@ -0,0 +1,19 @@
+// RUN: %clang -triple i386 -### -no-integrated-as %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix NOIAS
+
+// NOIAS: -no-integrated-as
+
+// RUN: %clang -triple i386 -### -integrated-as %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix IAS
+
+// IAS-NOT: -no-integrated-as
+
+// RUN: %clang -triple i386 -### %s 2>&1 | FileCheck %s -check-prefix DEFAULT
+
+// DEFAULT-NOT: -no-integrated-as
+
+// RUN: %clang -triple msp430 -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix NO-IAS-DEFAULT
+
+// NO-IAS-DEFAULT-NOT: -no-integrated-as
+
More information about the cfe-commits
mailing list