trivial QoI improvement. On this invalid input:
authorChris Lattner <sabre@nondot.org>
Thu, 18 Nov 2010 02:53:02 +0000 (02:53 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 18 Nov 2010 02:53:02 +0000 (02:53 +0000)
  sahf movl 344(%rdi),%r14d
we used to produce:

t.s:2:1: error: unexpected token in argument list

^

we now produce:
t.s:1:11: error: unexpected token in argument list
sahf movl 344(%rdi),%r14d
          ^

rdar://8581401

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119676 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmParser/X86AsmParser.cpp

index 655eeb5ec0fbacdce7327295ec5d33ef9f6b9db7..ca2af1fbecef04f12497e2d60ffac953cb20197f 100644 (file)
@@ -744,8 +744,9 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
     }
 
     if (getLexer().isNot(AsmToken::EndOfStatement)) {
+      SMLoc Loc = getLexer().getLoc();
       Parser.EatToEndOfStatement();
-      return TokError("unexpected token in argument list");
+      return Error(Loc, "unexpected token in argument list");
     }
   }