[mips] Add comment which explains why we need to change the assembler options before...
authorToma Tabacu <toma.tabacu@imgtec.com>
Fri, 9 Jan 2015 15:00:30 +0000 (15:00 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Fri, 9 Jan 2015 15:00:30 +0000 (15:00 +0000)
llvm-svn: 225521

llvm/lib/Target/Mips/MipsAsmPrinter.cpp

index 53b79ee..50c0441 100644 (file)
@@ -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();