From c2060a50efe3945eac63830f4b922d4e4fe596be Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 24 Jul 2017 20:48:15 +0000 Subject: [PATCH] Revert "[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two collides" This reverts r308867 and r308866. It broke the sanitizer-windows buildbot on C++ code similar to the following: namespace cl { } void f() { __asm { mov al, cl } } t.cpp(4,13): error: unexpected namespace name 'cl': expected expression mov al, cl ^ In this case, MSVC parses 'cl' as a register, not a namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308926 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmParser/X86AsmParser.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 31951c928f2..c1d216c8b7a 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -944,8 +944,7 @@ bool X86AsmParser::ParseRegister(unsigned &RegNo, EndLoc = Tok.getEndLoc(); if (Tok.isNot(AsmToken::Identifier)) { - if (isParsingIntelSyntax()) - return true; + if (isParsingIntelSyntax()) return true; return Error(StartLoc, "invalid register name", SMRange(StartLoc, EndLoc)); } @@ -956,16 +955,6 @@ bool X86AsmParser::ParseRegister(unsigned &RegNo, if (RegNo == 0) RegNo = MatchRegisterName(Tok.getString().lower()); - // In MS inline-asm we allow variables to be named as registers, and - // give them precedence over actual registers - // However - we require the match to be case sensitive - if (isParsingInlineAsm() && isParsingIntelSyntax() && RegNo) { - StringRef LineBuf(Tok.getIdentifier().data()); - InlineAsmIdentifierInfo Info; - if (SemaCallback->LookupInlineAsmIdentifier(LineBuf, Info, false)) - return true; - } - // The "flags" register cannot be referenced directly. // Treat it as an identifier instead. if (isParsingInlineAsm() && isParsingIntelSyntax() && RegNo == X86::EFLAGS)