From: Rafael Espindola Date: Fri, 21 Feb 2014 03:14:07 +0000 (+0000) Subject: Accept -no-integrated-as in -cc1 and forward it to llvm. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa983653b054e1dd0d90f2127e4649e8b84f5e9d;p=clang Accept -no-integrated-as in -cc1 and forward it to llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201837 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 82c7c30c33..915b502b93 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -1191,7 +1191,7 @@ def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Gr 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; -def no_integrated_as : Flag<["-"], "no-integrated-as">, Flags<[DriverOption]>; +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; def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">; diff --git a/include/clang/Frontend/CodeGenOptions.def b/include/clang/Frontend/CodeGenOptions.def index 1e81dd2b52..400591a08a 100644 --- a/include/clang/Frontend/CodeGenOptions.def +++ b/include/clang/Frontend/CodeGenOptions.def @@ -28,6 +28,7 @@ CODEGENOPT(Name, Bits, Default) CODEGENOPT(Name, Bits, Default) #endif +CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as CODEGENOPT(Autolink , 1, 1) ///< -fno-autolink CODEGENOPT(AsmVerbose , 1, 0) ///< -dA, -fverbose-asm. CODEGENOPT(ObjCAutoRefCountExceptions , 1, 0) ///< Whether ARC should be EH-safe. diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index d6d4f47dd6..3e5ee2cb55 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -438,6 +438,9 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { llvm::TargetOptions Options; + if (CodeGenOpts.DisableIntegratedAS) + Options.DisableIntegratedAS = true; + // Set frame pointer elimination mode. if (!CodeGenOpts.DisableFPElim) { Options.NoFramePointerElim = false; diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index a058a9c86c..4184847ec5 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -366,6 +366,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, (Opts.OptimizationLevel > 1 && !Opts.OptimizeSize)); Opts.RerollLoops = Args.hasArg(OPT_freroll_loops); + Opts.DisableIntegratedAS = Args.hasArg(OPT_no_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); diff --git a/test/CodeGen/2010-06-17-asmcrash.c b/test/CodeGen/2010-06-17-asmcrash.c index f13ef0c77b..048e429661 100644 --- a/test/CodeGen/2010-06-17-asmcrash.c +++ b/test/CodeGen/2010-06-17-asmcrash.c @@ -1,5 +1,5 @@ // REQUIRES: x86-registered-target -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O1 -mllvm -no-integrated-as \ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O1 -no-integrated-as \ // RUN: -S -o - %s | FileCheck %s typedef long long int64_t; diff --git a/test/Frontend/backend-diagnostic.c b/test/Frontend/backend-diagnostic.c index 00b3f48757..8b61c0350e 100644 --- a/test/Frontend/backend-diagnostic.c +++ b/test/Frontend/backend-diagnostic.c @@ -4,17 +4,17 @@ // _PROMOTE_: Promote warning to error. // _IGNORE_: Drop backend warning. // -// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -mllvm -no-integrated-as -S -o - -triple=i386-apple-darwin 2> %t.err +// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin 2> %t.err // RUN: FileCheck < %t.err %s --check-prefix=REGULAR --check-prefix=ASM -// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -mllvm -no-integrated-as -S -o - -triple=i386-apple-darwin -Werror=frame-larger-than 2> %t.err +// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Werror=frame-larger-than 2> %t.err // RUN: FileCheck < %t.err %s --check-prefix=PROMOTE --check-prefix=ASM -// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -mllvm -no-integrated-as -S -o - -triple=i386-apple-darwin -Wno-frame-larger-than 2> %t.err +// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Wno-frame-larger-than 2> %t.err // RUN: FileCheck < %t.err %s --check-prefix=IGNORE --check-prefix=ASM // // Currently the stack size reporting cannot be checked with -verify because // no source location is attached to the diagnostic. Therefore do not emit // them for the -verify test for now. -// RUN: %clang_cc1 %s -S -o - -triple=i386-apple-darwin -verify -mllvm -no-integrated-as +// RUN: %clang_cc1 %s -S -o - -triple=i386-apple-darwin -verify -no-integrated-as extern void doIt(char *);