summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2015-03-12 19:21:16 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2015-03-12 19:21:16 +0000
commit4351822ac5fb735ceea85d7b36ca0663a67a4efa (patch)
treeef2af13fd385de6d4b9bb45911ee4b62d0656637
parent60d1be210d7069b3e8d0f202f7cbd68b4533b2cf (diff)
downloadllvm-4351822ac5fb735ceea85d7b36ca0663a67a4efa.tar.gz
Merging r225521:
------------------------------------------------------------------------ r225521 | tomatabacu | 2015-01-09 15:00:30 +0000 (Fri, 09 Jan 2015) | 1 line [mips] Add comment which explains why we need to change the assembler options before and after inline asm blocks. NFC. ------------------------------------------------------------------------ llvm-svn: 232084
-rw-r--r--llvm/lib/Target/Mips/MipsAsmPrinter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
index 94b7c0d9807b..fac3f79491b9 100644
--- a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -725,6 +725,12 @@ void MipsAsmPrinter::emitInlineAsmStart(
const MCSubtargetInfo &StartInfo) const {
MipsTargetStreamer &TS = getTargetStreamer();
+ // GCC's choice of assembler options for inline assembly code ('at', 'macro'
+ // and 'reorder') is different from LLVM's choice for generated code ('noat',
+ // 'nomacro' and 'noreorder').
+ // In order to maintain compatibility with inline assembly code which depends
+ // on GCC's assembler options being used, we have to switch to those options
+ // for the duration of the inline assembly block and then switch back.
TS.emitDirectiveSetPush();
TS.emitDirectiveSetAt();
TS.emitDirectiveSetMacro();