[llvm-commits] [llvm] r162295 - in /llvm/trunk: include/llvm/MC/MCTargetAsmParser.h lib/Target/X86/AsmParser/X86AsmParser.cpp

Chad Rosier mcrosier at apple.com
Tue Aug 21 11:14:59 PDT 2012


Author: mcrosier
Date: Tue Aug 21 13:14:59 2012
New Revision: 162295

URL: http://llvm.org/viewvc/llvm-project?rev=162295&view=rev
Log:
[ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl.  In general,
this is the index of the operand that failed to match.

Note: This may cause a buildbot failure due to an API mismatch in clang.  Should
recover with my next commit to clang.

Modified:
    llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp

Modified: llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetAsmParser.h?rev=162295&r1=162294&r2=162295&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCTargetAsmParser.h (original)
+++ llvm/trunk/include/llvm/MC/MCTargetAsmParser.h Tue Aug 21 13:14:59 2012
@@ -88,7 +88,9 @@
   virtual bool
   MatchInstruction(SMLoc IDLoc,
                    SmallVectorImpl<MCParsedAsmOperand*> &Operands,
-                   SmallVectorImpl<MCInst> &MCInsts) {
+                   SmallVectorImpl<MCInst> &MCInsts,
+                   unsigned &OrigErrorInfo) {
+    OrigErrorInfo = ~0x0;
     return true;
   }
 

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=162295&r1=162294&r2=162295&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue Aug 21 13:14:59 2012
@@ -67,7 +67,8 @@
 
   bool MatchInstruction(SMLoc IDLoc,
                         SmallVectorImpl<MCParsedAsmOperand*> &Operands,
-                        SmallVectorImpl<MCInst> &MCInsts);
+                        SmallVectorImpl<MCInst> &MCInsts,
+                        unsigned &OrigErrorInfo);
 
   /// isSrcOp - Returns true if operand is either (%rsi) or %ds:%(rsi)
   /// in 64bit mode or (%esi) or %es:(%esi) in 32bit mode.
@@ -1513,7 +1514,8 @@
                         SmallVectorImpl<MCParsedAsmOperand*> &Operands,
                         MCStreamer &Out) {
   SmallVector<MCInst, 2> Insts;
-  bool Error = MatchInstruction(IDLoc, Operands, Insts);
+  unsigned ErrorInfo;
+  bool Error = MatchInstruction(IDLoc, Operands, Insts, ErrorInfo);
   if (!Error)
     for (unsigned i = 0, e = Insts.size(); i != e; ++i)
       Out.EmitInstruction(Insts[i]);
@@ -1523,7 +1525,8 @@
 bool X86AsmParser::
 MatchInstruction(SMLoc IDLoc,
                  SmallVectorImpl<MCParsedAsmOperand*> &Operands,
-                 SmallVectorImpl<MCInst> &MCInsts) {
+                 SmallVectorImpl<MCInst> &MCInsts,
+                 unsigned &OrigErrorInfo) {
   assert(!Operands.empty() && "Unexpect empty operand list!");
   X86Operand *Op = static_cast<X86Operand*>(Operands[0]);
   assert(Op->isToken() && "Leading operand should always be a mnemonic!");
@@ -1558,7 +1561,6 @@
   }
 
   bool WasOriginallyInvalidOperand = false;
-  unsigned OrigErrorInfo;
   MCInst Inst;
 
   // First, try a direct match.





More information about the llvm-commits mailing list