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
This commit is contained in:
Rafael Espindola 2014-02-21 03:13:54 +00:00
parent ed6718d228
commit 9f5066c72c
4 changed files with 21 additions and 16 deletions

View File

@ -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

View File

@ -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.

View File

@ -53,10 +53,6 @@ static cl::opt<cl::boolOrDefault>
AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
cl::init(cl::BOU_UNSET));
static cl::opt<bool>
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;

View File

@ -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<bool>
NoIntegratedAssembler("no-integrated-as", cl::Hidden,
cl::desc("Disable integrated assembler"));
// Determine optimization level.
static cl::opt<char>
OptLevel("O",
@ -260,6 +264,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
}
TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
Options.DisableIntegratedAS = NoIntegratedAssembler;
OwningPtr<TargetMachine>
target(TheTarget->createTargetMachine(TheTriple.getTriple(),