diff options
| author | Chad Rosier <mcrosier@apple.com> | 2012-08-21 18:14:59 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@apple.com> | 2012-08-21 18:14:59 +0000 |
| commit | 79e766c38e61a672a9a1845b6075ce6db940d158 (patch) | |
| tree | 92bc0dd4d28951ee0939c4b4f683d4a62340b45d /llvm/lib/Target | |
| parent | a9a2af78937b0365b67eaad1d5d67469620a05bc (diff) | |
| download | bcm5719-llvm-79e766c38e61a672a9a1845b6075ce6db940d158.tar.gz bcm5719-llvm-79e766c38e61a672a9a1845b6075ce6db940d158.zip | |
[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.
llvm-svn: 162295
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index fbbaa9500c9..c139dbce034 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -67,7 +67,8 @@ private: 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 @@ MatchAndEmitInstruction(SMLoc IDLoc, 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 @@ MatchAndEmitInstruction(SMLoc IDLoc, 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 @@ MatchInstruction(SMLoc IDLoc, } bool WasOriginallyInvalidOperand = false; - unsigned OrigErrorInfo; MCInst Inst; // First, try a direct match. |

