[llvm-commits] [llvm] r113945 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/X86/x86_instructions.s
Chris Lattner
sabre at nondot.org
Tue Sep 14 22:14:54 PDT 2010
Author: lattner
Date: Wed Sep 15 00:14:54 2010
New Revision: 113945
URL: http://llvm.org/viewvc/llvm-project?rev=113945&view=rev
Log:
Disambiguate lcall/ljmp to the 32-bit version. This happens
even in 64-bit mode apparently.
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s
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=113945&r1=113944&r2=113945&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Sep 15 00:14:54 2010
@@ -979,6 +979,16 @@
NameLoc, NameLoc));
}
+ // lcall *x and ljmp *x -> lcalll and ljmpl
+ if ((Name == "lcall" || Name == "ljmp") &&
+ Operands.size() == 3 &&
+ static_cast<X86Operand*>(Operands[1])->isToken() &&
+ static_cast<X86Operand*>(Operands[1])->getToken() == "*") {
+ delete Operands[0];
+ Operands[0] = X86Operand::CreateToken(Name == "lcall" ? "lcalll" : "ljmpl",
+ NameLoc);
+ }
+
return false;
}
Modified: llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s?rev=113945&r1=113944&r2=113945&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s Wed Sep 15 00:14:54 2010
@@ -288,3 +288,9 @@
sldt %ecx
sldt %cx
+// CHECK: lcalll *3135175374
+// CHECK: ljmpl *3135175374
+lcall *0xbadeface
+ljmp *0xbadeface
+
+
More information about the llvm-commits
mailing list