1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

MC intel asm parser: Allow @ at the start of function names.

Ports parts of r193000 to the intel parser. Fixes part of PR36676.

https://reviews.llvm.org/D44359

llvm-svn: 327262
This commit is contained in:
Nico Weber 2018-03-12 12:47:27 +00:00
parent 1564deb6b6
commit 07cba6eaaa
2 changed files with 9 additions and 2 deletions

View File

@ -1383,6 +1383,7 @@ bool X86AsmParser::ParseIntelExpression(IntelExprStateMachine &SM, SMLoc &End) {
if (ParseIntelDotOperator(SM, End))
return true;
break;
case AsmToken::At:
case AsmToken::String:
case AsmToken::Identifier: {
SMLoc IdentLoc = Tok.getLoc();
@ -1390,7 +1391,7 @@ bool X86AsmParser::ParseIntelExpression(IntelExprStateMachine &SM, SMLoc &End) {
UpdateLocLex = false;
// Register
unsigned Reg;
if (Tok.isNot(AsmToken::String) && !ParseRegister(Reg, IdentLoc, End)) {
if (Tok.is(AsmToken::Identifier) && !ParseRegister(Reg, IdentLoc, End)) {
if (SM.onRegister(Reg, ErrMsg))
return Error(Tok.getLoc(), ErrMsg);
break;
@ -1428,6 +1429,9 @@ bool X86AsmParser::ParseIntelExpression(IntelExprStateMachine &SM, SMLoc &End) {
break;
}
// MS InlineAsm identifier
// Call parseIdentifier() to combine @ with the identifier behind it.
if (TK == AsmToken::At && Parser.parseIdentifier(Identifier))
return Error(IdentLoc, "expected identifier");
if (ParseIntelInlineAsmIdentifier(Val, Identifier, Info, false, End))
return true;
else if (SM.onIdentifierExpr(Val, Identifier, Info, true, ErrMsg))

View File

@ -1,8 +1,11 @@
; Check how tricky symbols are printed in the asm output.
; RUN: llc -mtriple=i686-pc-win32 %s -o - | FileCheck %s --check-prefix=ASM
; RUN: llc -mtriple=i686-pc-win32 %s -x86-asm-syntax=intel -o - | FileCheck %s --check-prefix=ASM
; Check that we can roundtrip these names through our assembler.
; Check that we can roundtrip these names through our assembler,
; in both at&t and intel syntax.
; RUN: llc -mtriple=i686-pc-win32 %s -o - | llvm-mc -triple i686-pc-win32 -filetype=obj | llvm-readobj -t | FileCheck %s --check-prefix=READOBJ
; RUN: llc -mtriple=i686-pc-win32 -x86-asm-syntax=intel %s -o - | llvm-mc -triple i686-pc-win32 -filetype=obj | llvm-readobj -t | FileCheck %s --check-prefix=READOBJ
@"\01??__E_Generic_object@?$_Error_objects@H@std@@YAXXZ" = global i32 0