Make DisableIntegratedAS a TargetOption.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 21 Feb 2014 03:13:54 +0000 (03:13 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 21 Feb 2014 03:13:54 +0000 (03:13 +0000)
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
include/llvm/Target/TargetOptions.h
lib/CodeGen/LLVMTargetMachine.cpp
tools/llc/llc.cpp

index 4aab5423074db6a159171e74dab66985c4379f95..42127c81f707bf954bdbbccd5bc1938443eb6264 100644 (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
index d9c8651e7ed0e7b0ddb7ed5bb51710d8b89f2521..f50af6734b11abf374e84b59209eb4ee089c67c6 100644 (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.
index 51cd9d68617c5469d8368da1defc53d0bc6b4c5a..6c217cd232e1745143e53e7716869fe3c32ba361 100644 (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;
index 435d4e22b7841b10a6452d905ae68dcd5c027aa8..f8f02831913d16ca4b9ba19459b6b4d458e9729c 100644 (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(),