[llvm] r225521 - [mips] Add comment which explains why we need to change the assembler options before and after inline asm blocks. NFC.
Toma Tabacu
toma.tabacu at imgtec.com
Fri Jan 9 07:00:30 PST 2015
Author: tomatabacu
Date: Fri Jan 9 09:00:30 2015
New Revision: 225521
URL: http://llvm.org/viewvc/llvm-project?rev=225521&view=rev
Log:
[mips] Add comment which explains why we need to change the assembler options before and after inline asm blocks. NFC.
Modified:
llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=225521&r1=225520&r2=225521&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Fri Jan 9 09:00:30 2015
@@ -747,6 +747,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();
More information about the llvm-commits
mailing list