[mips] Set GCC-compatible MIPS asssembler options before inline asm blocks.
authorToma Tabacu <toma.tabacu@imgtec.com>
Wed, 17 Dec 2014 10:56:16 +0000 (10:56 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Wed, 17 Dec 2014 10:56:16 +0000 (10:56 +0000)
commit3fea427a639363f550423322c2ace5da7f1f15a0
treeee966c51d10c7a4eddaea81230be3b182941e8bf
parent4bfc4f2e8ca185f850998e90fb11c76ff1a1c98e
[mips] Set GCC-compatible MIPS asssembler options before inline asm blocks.

Summary:
When generating MIPS assembly, LLVM always overrides the default assembler options by emitting the '.set noreorder', '.set nomacro' and '.set noat' directives,
while GCC uses the default options if an assembly-level function contains inline assembly code.

This becomes a problem when the code generated by LLVM is interleaved with inline assembly which assumes GCC-like assembler options (from Linux, for example).

This patch fixes these conflicts by setting the appropriate assembler options at the beginning of an inline asm block and popping them at the end.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6637

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224425 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/Target/Mips/Mips16HardFloat.cpp
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsAsmPrinter.h
test/CodeGen/Mips/fptr2.ll [deleted file]
test/CodeGen/Mips/inlineasm-assembler-directives.ll [new file with mode: 0644]
test/CodeGen/Mips/inlineasm-cnstrnt-reg.ll
test/CodeGen/Mips/inlineasmmemop.ll