From bdab504afd7d34dc6b49ba6ec9190d0cc4a3b29c Mon Sep 17 00:00:00 2001
From: Toma Tabacu <toma.tabacu@imgtec.com>
Date: Fri, 9 Jan 2015 15:00:30 +0000
Subject: [PATCH] [mips] Add comment which explains why we need to change the
 assembler options before and after inline asm blocks. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225521 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Target/Mips/MipsAsmPrinter.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index 53b79eeacea..50c0441e0dd 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -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();