From 9f5066c72c0aa77cc3a0a26f6e9f38af5daeeccb Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 21 Feb 2014 03:13:54 +0000 Subject: [PATCH] Make DisableIntegratedAS a TargetOption. This replaces the old NoIntegratedAssembler with at TargetOption. This is more flexible and will be used to forward clang's -no-integrated-as option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201836 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ReleaseNotes.rst | 3 ++- include/llvm/Target/TargetOptions.h | 23 +++++++++++++---------- lib/CodeGen/LLVMTargetMachine.cpp | 6 +----- tools/llc/llc.cpp | 5 +++++ 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 4aab5423074..42127c81f70 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -49,7 +49,8 @@ Non-comprehensive list of changes in this release * All inline assembly is parsed by the integrated assembler when it is enabled. Previously this was only the case for object-file output. It is now the case - for assembly output as well. + for assembly output as well. The integrated assembler can be disabled with + the ``-no-integrated-as`` option, .. NOTE For small 1-3 sentence descriptions, just add an entry at the end of diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h index d9c8651e7ed..f50af6734b1 100644 --- a/include/llvm/Target/TargetOptions.h +++ b/include/llvm/Target/TargetOptions.h @@ -42,17 +42,17 @@ namespace llvm { public: TargetOptions() : PrintMachineCode(false), NoFramePointerElim(false), - LessPreciseFPMADOption(false), - UnsafeFPMath(false), NoInfsFPMath(false), - NoNaNsFPMath(false), HonorSignDependentRoundingFPMathOption(false), - UseSoftFloat(false), NoZerosInBSS(false), - JITEmitDebugInfo(false), JITEmitDebugInfoToDisk(false), - GuaranteedTailCallOpt(false), DisableTailCalls(false), - StackAlignmentOverride(0), + LessPreciseFPMADOption(false), UnsafeFPMath(false), + NoInfsFPMath(false), NoNaNsFPMath(false), + HonorSignDependentRoundingFPMathOption(false), UseSoftFloat(false), + NoZerosInBSS(false), JITEmitDebugInfo(false), + JITEmitDebugInfoToDisk(false), GuaranteedTailCallOpt(false), + DisableTailCalls(false), StackAlignmentOverride(0), EnableFastISel(false), PositionIndependentExecutable(false), - EnableSegmentedStacks(false), UseInitArray(false), TrapFuncName(""), - FloatABIType(FloatABI::Default), AllowFPOpFusion(FPOpFusion::Standard) - {} + EnableSegmentedStacks(false), UseInitArray(false), + DisableIntegratedAS(false), TrapFuncName(""), + FloatABIType(FloatABI::Default), + AllowFPOpFusion(FPOpFusion::Standard) {} /// PrintMachineCode - This flag is enabled when the -print-machineinstrs /// option is specified on the command line, and should enable debugging @@ -158,6 +158,9 @@ namespace llvm { /// constructors. unsigned UseInitArray : 1; + /// Disable the integrated assembler. + unsigned DisableIntegratedAS : 1; + /// getTrapFunctionName - If this returns a non-empty string, this means /// isel should lower Intrinsic::trap to a call to the specified function /// name instead of an ISD::TRAP node. diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 51cd9d68617..6c217cd232e 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -53,10 +53,6 @@ static cl::opt AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), cl::init(cl::BOU_UNSET)); -static cl::opt -NoIntegratedAssembler("no-integrated-as", cl::Hidden, - cl::desc("Disable integrated assembler")); - static bool getVerboseAsm() { switch (AsmVerbose) { case cl::BOU_UNSET: return TargetMachine::getAsmVerbosityDefault(); @@ -77,7 +73,7 @@ void LLVMTargetMachine::initAsmInfo() { "Make sure you include the correct TargetSelect.h" "and that InitializeAllTargetMCs() is being invoked!"); - if (NoIntegratedAssembler) + if (Options.DisableIntegratedAS) TmpAsmInfo->setUseIntegratedAssembler(false); AsmInfo = TmpAsmInfo; diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 435d4e22b78..f8f02831913 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -58,6 +58,10 @@ TimeCompilations("time-compilations", cl::Hidden, cl::init(1u), cl::value_desc("N"), cl::desc("Repeat compilation N times for timing")); +static cl::opt +NoIntegratedAssembler("no-integrated-as", cl::Hidden, + cl::desc("Disable integrated assembler")); + // Determine optimization level. static cl::opt OptLevel("O", @@ -260,6 +264,7 @@ static int compileModule(char **argv, LLVMContext &Context) { } TargetOptions Options = InitTargetOptionsFromCodeGenFlags(); + Options.DisableIntegratedAS = NoIntegratedAssembler; OwningPtr target(TheTarget->createTargetMachine(TheTriple.getTriple(), -- 2.34.1