OSDN Git Service

Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTe...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 13 Feb 2014 14:44:26 +0000 (14:44 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 13 Feb 2014 14:44:26 +0000 (14:44 +0000)
commit38c6b58eec1e65c969299771a4896015151bbef7
tree24b6159b36f4444d2ddcfa0b8704691e8fa70182
parent5d9d24daef53c7b9646da355297deda6753565a8
Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call

Summary:
AsmPrinter::EmitInlineAsm() will no longer use the EmitRawText() call for
targets with mature MC support. Such targets will always parse the inline
assembly (even when emitting assembly). Targets without mature MC support
continue to use EmitRawText() for assembly output.

The hasRawTextSupport() check in AsmPrinter::EmitInlineAsm() has been replaced
with MCAsmInfo::UseIntegratedAs which when true, causes the integrated assembler
to parse inline assembly (even when emitting assembly output). UseIntegratedAs
is set to true for targets that consider any failure to parse valid assembly
to be a bug. Target specific subclasses generally enable the integrated
assembler in their constructor. The default value can be overridden with
-no-integrated-as.

All tests that rely on inline assembly supporting invalid assembly (for example,
those that use mnemonics such as 'foo' or 'hello world') have been updated to
disable the integrated assembler.

Changes since review (and last commit attempt):
- Fixed test failures that were missed due to configuration of local build.
  (fixes crash.ll and a couple others).
- Fixed tests that happened to pass because the local build was on X86
  (should fix 2007-12-17-InvokeAsm.ll)
- mature-mc-support.ll's should no longer require all targets to be compiled.
  (should fix ARM and PPC buildbots)
- Object output (-filetype=obj and similar) now forces the integrated assembler
  to be enabled regardless of default setting or -no-integrated-as.
  (should fix SystemZ buildbots)

Reviewers: rafael

Reviewed By: rafael

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2686

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201333 91177308-0d34-0410-b5e6-96231b3b80d8
94 files changed:
include/llvm/MC/MCAsmInfo.h
include/llvm/MC/MCObjectStreamer.h
include/llvm/MC/MCStreamer.h
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/CodeGen/LLVMTargetMachine.cpp
lib/MC/MCAsmInfo.cpp
lib/MC/MCAsmInfoCOFF.cpp
lib/MC/MCAsmInfoDarwin.cpp
lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h
lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
test/CodeGen/AArch64/inline-asm-constraints.ll
test/CodeGen/AArch64/inline-asm-modifiers.ll
test/CodeGen/AArch64/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/ARM/2009-04-06-AsmModifier.ll
test/CodeGen/ARM/arm-modifier.ll
test/CodeGen/ARM/crash-O0.ll
test/CodeGen/ARM/inlineasm-64bit.ll
test/CodeGen/ARM/inlineasm-imm-arm.ll
test/CodeGen/ARM/inlineasm3.ll
test/CodeGen/ARM/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/ARM/mult-alt-generic-arm.ll
test/CodeGen/ARM/subreg-remat.ll
test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll
test/CodeGen/Generic/2007-04-27-LargeMemObject.ll
test/CodeGen/Generic/2007-12-17-InvokeAsm.ll
test/CodeGen/Generic/2008-02-20-MatchingMem.ll
test/CodeGen/Generic/asm-large-immediate.ll
test/CodeGen/Generic/inline-asm-mem-clobber.ll
test/CodeGen/Generic/inline-asm-special-strings.ll
test/CodeGen/Mips/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll
test/CodeGen/PowerPC/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/SPARC/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/SystemZ/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/Thumb/inlineasm-imm-thumb.ll
test/CodeGen/Thumb/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/X86/2006-07-20-InlineAsm.ll
test/CodeGen/X86/2006-07-31-SingleRegClass.ll
test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
test/CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll
test/CodeGen/X86/2007-11-04-LiveVariablesBug.ll
test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll
test/CodeGen/X86/2008-02-26-AsmDirectMemOp.ll
test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll
test/CodeGen/X86/2008-09-18-inline-asm-2.ll
test/CodeGen/X86/2008-10-17-Asm64bitRConstraint.ll
test/CodeGen/X86/2008-10-20-AsmDoubleInI32.ll
test/CodeGen/X86/2009-02-12-InlineAsm-nieZ-constraints.ll
test/CodeGen/X86/2009-04-13-2AddrAssert-2.ll
test/CodeGen/X86/2009-05-08-InlineAsmIOffset.ll
test/CodeGen/X86/2009-09-19-earlyclobber.ll
test/CodeGen/X86/2009-12-01-EarlyClobberBug.ll
test/CodeGen/X86/2010-05-05-LocalAllocEarlyClobber.ll
test/CodeGen/X86/2010-06-15-FastAllocEarlyCLobber.ll
test/CodeGen/X86/2010-06-25-asm-RA-crash.ll
test/CodeGen/X86/2010-06-28-FastAllocTiedOperand.ll
test/CodeGen/X86/2010-06-28-matched-g-constraint.ll
test/CodeGen/X86/2010-07-02-asm-alignstack.ll
test/CodeGen/X86/2010-07-06-asm-RIP.ll
test/CodeGen/X86/2010-07-13-indirectXconstraint.ll
test/CodeGen/X86/2011-10-11-SpillDead.ll
test/CodeGen/X86/asm-block-labels.ll
test/CodeGen/X86/asm-global-imm.ll
test/CodeGen/X86/cas.ll
test/CodeGen/X86/crash.ll
test/CodeGen/X86/fast-isel.ll
test/CodeGen/X86/fold-xmm-zero.ll
test/CodeGen/X86/inline-asm-flag-clobber.ll
test/CodeGen/X86/inline-asm-fpstack.ll
test/CodeGen/X86/inline-asm-h.ll
test/CodeGen/X86/inline-asm-modifier-n.ll
test/CodeGen/X86/inline-asm-mrv.ll
test/CodeGen/X86/inline-asm-q-regs.ll
test/CodeGen/X86/inline-asm-stack-realign3.ll
test/CodeGen/X86/inline-asm-tied.ll
test/CodeGen/X86/inline-asm-x-scalar.ll
test/CodeGen/X86/inline-asm.ll
test/CodeGen/X86/mature-mc-support.ll [new file with mode: 0644]
test/CodeGen/X86/ms-inline-asm.ll
test/CodeGen/X86/mult-alt-generic-i686.ll
test/CodeGen/X86/mult-alt-generic-x86_64.ll
test/CodeGen/X86/mult-alt-x86.ll
test/CodeGen/X86/multiple-loop-post-inc.ll
test/CodeGen/X86/opaque-constant-asm.ll
test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll