fix a bug in range information for $42, eliminate an 
unneeded argument from ParseExpression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93536 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index b350c9f..c2459c9 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -279,10 +279,10 @@
   }
   case AsmToken::Dollar: {
     // $42 -> immediate.
+    SMLoc Start = getLexer().getTok().getLoc(), End;
     getLexer().Lex();
     const MCExpr *Val;
-    SMLoc Start, End;
-    if (getParser().ParseExpression(Val, Start, End))
+    if (getParser().ParseExpression(Val, End))
       return 0;
     return X86Operand::CreateImm(Val, Start, End);
   }
@@ -302,15 +302,15 @@
   // it.
   const MCExpr *Disp = MCConstantExpr::Create(0, getParser().getContext());
   if (getLexer().isNot(AsmToken::LParen)) {
-    SMLoc ExprStart, ExprEnd;
-    if (getParser().ParseExpression(Disp, MemStart, ExprEnd)) return 0;
+    SMLoc ExprEnd;
+    if (getParser().ParseExpression(Disp, ExprEnd)) return 0;
     
     // After parsing the base expression we could either have a parenthesized
     // memory address or not.  If not, return now.  If so, eat the (.
     if (getLexer().isNot(AsmToken::LParen)) {
       // Unless we have a segment register, treat this as an immediate.
       if (SegReg == 0)
-        return X86Operand::CreateImm(Disp, ExprStart, ExprEnd);
+        return X86Operand::CreateImm(Disp, MemStart, ExprEnd);
       return X86Operand::CreateMem(SegReg, Disp, 0, 0, 1, MemStart, ExprEnd);
     }