<div dir="ltr">FTR, this was reverted in r309005.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 25, 2017 at 7:49 PM, Kostya Serebryany via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi. <div>This patch causes the msan bots to complain. Please fix or revert ASAP. </div><div><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/6702/steps/check-clang%20msan/logs/stdio" target="_blank">http://lab.llvm.org:8011/<wbr>builders/sanitizer-x86_64-<wbr>linux-fast/builds/6702/steps/<wbr>check-clang%20msan/logs/stdio</a><br></div><div><pre style="font-family:"Courier New",courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span class="m_7656581400355345593gmail-stdout">Testing: 0 .. 10..
FAIL: Clang :: CodeGen/ms_this.cpp (2142 of 11057)
******************** TEST 'Clang :: CodeGen/ms_this.cpp' FAILED ********************
Script:
--
/mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm_build_msan/./bin/<wbr>clang -cc1 -internal-isystem /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm_build_msan/lib/<wbr>clang/6.0.0/include -nostdsysteminc -triple x86_64-pc-win32 -fasm-blocks -emit-llvm /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/test/<wbr>CodeGen/ms_this.cpp -o - | /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm_build_msan/./bin/<wbr>FileCheck /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/test/<wbr>CodeGen/ms_this.cpp
--
Exit Code: 2
Command Output (stderr):
--
==4713==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x3143ba3 in (anonymous namespace)::X86AsmParser::<wbr>ParseIntelIdentifier(llvm::<wbr>MCExpr const*&, llvm::StringRef&, llvm::InlineAsmIdentifierInfo&<wbr>, bool, llvm::SMLoc&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/Target/X86/<wbr>AsmParser/X86AsmParser.cpp:<wbr>1664:7
#1 0x313f288 in (anonymous namespace)::X86AsmParser::<wbr>ParseIntelExpression((<wbr>anonymous namespace)::X86AsmParser::<wbr>IntelExprStateMachine&, llvm::SMLoc&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/Target/X86/<wbr>AsmParser/X86AsmParser.cpp:<wbr>1440:13
#2 0x31389e7 in (anonymous namespace)::X86AsmParser::<wbr>ParseIntelBracExpression(<wbr>unsigned int, llvm::SMLoc, long, bool, unsigned int) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/Target/X86/<wbr>AsmParser/X86AsmParser.cpp:<wbr>1555:7
#3 0x31307f8 in ParseIntelOperand /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/Target/X86/<wbr>AsmParser/X86AsmParser.cpp:<wbr>1961:12
#4 0x31307f8 in (anonymous namespace)::X86AsmParser::<wbr>ParseOperand() /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/Target/X86/<wbr>AsmParser/X86AsmParser.cpp:<wbr>1225
#5 0x3118cda in (anonymous namespace)::X86AsmParser::<wbr>ParseInstruction(llvm::<wbr>ParseInstructionInfo&, llvm::StringRef, llvm::SMLoc, llvm::SmallVectorImpl<std::__<wbr>1::unique_ptr<llvm::<wbr>MCParsedAsmOperand, std::__1::default_delete<llvm:<wbr>:MCParsedAsmOperand> > >&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/Target/X86/<wbr>AsmParser/X86AsmParser.cpp:<wbr>2510:44
#6 0x4bb9a48 in (anonymous namespace)::AsmParser::<wbr>parseStatement((anonymous namespace)::<wbr>ParseStatementInfo&, llvm::MCAsmParserSemaCallback*<wbr>) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/MC/MCParser/<wbr>AsmParser.cpp:2034:42
#7 0x4ba63a3 in (anonymous namespace)::AsmParser::<wbr>parseMSInlineAsm(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned int&, unsigned int&, llvm::SmallVectorImpl<std::__<wbr>1::pair<void*, bool> >&, llvm::SmallVectorImpl<std::__<wbr>1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&, llvm::SmallVectorImpl<std::__<wbr>1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&, llvm::MCInstrInfo const*, llvm::MCInstPrinter const*, llvm::MCAsmParserSemaCallback&<wbr>) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/lib/MC/MCParser/<wbr>AsmParser.cpp:5343:25
#8 0x82f1100 in clang::Parser::<wbr>ParseMicrosoftAsmStatement(<wbr>clang::SourceLocation) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseStmtAsm.cpp:619:15
#9 0x82f6310 in clang::Parser::<wbr>ParseAsmStatement(bool&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseStmtAsm.cpp:682:12
#10 0x82d15d9 in clang::Parser::<wbr>ParseStatementOrDeclarationAft<wbr>erAttributes(llvm::<wbr>SmallVector<clang::Stmt*, 32u>&, clang::Parser::<wbr>AllowedConstructsKind, clang::SourceLocation*, clang::Parser::<wbr>ParsedAttributesWithRange&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseStmt.cpp:277:11
#11 0x82cfff1 in clang::Parser::<wbr>ParseStatementOrDeclaration(<wbr>llvm::SmallVector<clang::Stmt*<wbr>, 32u>&, clang::Parser::<wbr>AllowedConstructsKind, clang::SourceLocation*) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseStmt.cpp:110:20
#12 0x82e677b in clang::Parser::<wbr>ParseCompoundStatementBody(<wbr>bool) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseStmt.cpp:1001:11
#13 0x82e859f in clang::Parser::<wbr>ParseFunctionStatementBody(<wbr>clang::Decl*, clang::Parser::ParseScope&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseStmt.cpp:1967:21
#14 0x811b151 in clang::Parser::<wbr>ParseFunctionDefinition(clang:<wbr>:ParsingDeclarator&, clang::Parser::<wbr>ParsedTemplateInfo const&, clang::Parser::<wbr>LateParsedAttrList*) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/Parser.cpp:1214:10
#15 0x8167f18 in clang::Parser::ParseDeclGroup(<wbr>clang::ParsingDeclSpec&, unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseDecl.cpp:1953:11
#16 0x8118d8c in clang::Parser::<wbr>ParseDeclOrFunctionDefInternal<wbr>(clang::Parser::<wbr>ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/Parser.cpp:981:10
#17 0x8117646 in clang::Parser::<wbr>ParseDeclarationOrFunctionDefi<wbr>nition(clang::Parser::<wbr>ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/Parser.cpp:997:12
#18 0x8114428 in clang::Parser::<wbr>ParseExternalDeclaration(<wbr>clang::Parser::<wbr>ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/Parser.cpp:847:12
#19 0x8110552 in clang::Parser::<wbr>ParseTopLevelDecl(clang::<wbr>OpaquePtr<clang::DeclGroupRef><wbr>&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/Parser.cpp:615:12
#20 0x8101168 in clang::ParseAST(clang::Sema&, bool, bool) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Parse/ParseAST.cpp:147:18
#21 0x65ab84a in clang::FrontendAction::<wbr>Execute() /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Frontend/FrontendAction.cpp:<wbr>902:8
#22 0x64e936c in clang::CompilerInstance::<wbr>ExecuteAction(clang::<wbr>FrontendAction&) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>Frontend/CompilerInstance.cpp:<wbr>980:11
#23 0x6786441 in clang::<wbr>ExecuteCompilerInvocation(<wbr>clang::CompilerInstance*) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/lib/<wbr>FrontendTool/<wbr>ExecuteCompilerInvocation.cpp:<wbr>251:25
#24 0x98efea in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/tools/<wbr>driver/cc1_main.cpp:221:13
#25 0x988444 in ExecuteCC1Tool /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/tools/<wbr>driver/driver.cpp:306:12
#26 0x988444 in main /mnt/b/sanitizer-buildbot3/<wbr>sanitizer-x86_64-linux-fast/<wbr>build/llvm/tools/clang/tools/<wbr>driver/driver.cpp:387</span></pre></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 25, 2017 at 3:44 AM, Matan Haroush via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mharoush<br>
Date: Tue Jul 25 03:44:09 2017<br>
New Revision: 308966<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=308966&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=308966&view=rev</a><br>
Log:<br>
This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements.<br>
<br>
Differential Revision:<br>
<a href="https://reviews.llvm.org/D33277" rel="noreferrer" target="_blank">https://reviews.llvm.org/D3327<wbr>7</a><br>
<a href="https://reviews.llvm.org/D33278" rel="noreferrer" target="_blank">https://reviews.llvm.org/D3327<wbr>8</a><br>
<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/MC/MCP<wbr>arser/MCAsmParser.h<br>
llvm/trunk/lib/Target/X86/AsmP<wbr>arser/X86AsmParser.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/MC/MCP<wbr>arser/MCAsmParser.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCParser/MCAsmParser.h?rev=308966&r1=308965&r2=308966&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/include/llvm/<wbr>MC/MCParser/MCAsmParser.h?rev=<wbr>308966&r1=308965&r2=308966&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/include/llvm/MC/MCP<wbr>arser/MCAsmParser.h (original)<br>
+++ llvm/trunk/include/llvm/MC/MCP<wbr>arser/MCAsmParser.h Tue Jul 25 03:44:09 2017<br>
@@ -35,17 +35,30 @@ class MCTargetAsmParser;<br>
class SourceMgr;<br>
<br>
class InlineAsmIdentifierInfo {<br>
+private:<br>
+ enum IdDeclKind : uint8_t {<br>
+ Default,<br>
+ Variable,<br>
+ ConstEnum,<br>
+ };<br>
+ IdDeclKind Kind;<br>
+<br>
public:<br>
void *OpDecl;<br>
- bool IsVarDecl;<br>
unsigned Length, Size, Type;<br>
-<br>
+ APInt ConstIntValue;<br>
+ bool isVarDecl() { return Kind == Variable; }<br>
+ bool isConstEnum() { return Kind == ConstEnum; }<br>
+ void setKindVariable() { Kind = Variable; }<br>
+ void setKindConstEnum() { Kind = ConstEnum; }<br>
void clear() {<br>
OpDecl = nullptr;<br>
- IsVarDecl = false;<br>
+ Kind = Default;<br>
Length = 1;<br>
Size = 0;<br>
Type = 0;<br>
+ // On clear flush possibly old APInt value as a precaution;<br>
+ ConstIntValue = APInt();<br>
}<br>
};<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/X86/AsmP<wbr>arser/X86AsmParser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=308966&r1=308965&r2=308966&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/Target/X8<wbr>6/AsmParser/X86AsmParser.cpp?<wbr>rev=308966&r1=308965&r2=308966<wbr>&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Target/X86/AsmP<wbr>arser/X86AsmParser.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/AsmP<wbr>arser/X86AsmParser.cpp Tue Jul 25 03:44:09 2017<br>
@@ -749,7 +749,7 @@ private:<br>
std::unique_ptr<X86Operand> ParseIntelOffsetOfOperator();<br>
bool ParseIntelDotOperator(const MCExpr *Disp, const MCExpr *&NewDisp);<br>
unsigned IdentifyIntelOperator(StringRe<wbr>f Name);<br>
- unsigned ParseIntelOperator(unsigned OpKind);<br>
+ unsigned ParseIntelOperator(unsigned OpKind, bool AddImmPrefix);<br>
std::unique_ptr<X86Operand><br>
ParseIntelSegmentOverride(uns<wbr>igned SegReg, SMLoc Start, unsigned Size);<br>
std::unique_ptr<X86Operand> ParseRoundingModeOp(SMLoc Start, SMLoc End);<br>
@@ -1223,7 +1223,7 @@ std::unique_ptr<X86Operand> X86AsmParser<br>
InlineAsmIdentifierInfo &Info, bool AllowBetterSizeMatch) {<br>
// If we found a decl other than a VarDecl, then assume it is a FuncDecl or<br>
// some other label reference.<br>
- if (isa<MCSymbolRefExpr>(Disp) && Info.OpDecl && !Info.IsVarDecl) {<br>
+ if (isa<MCSymbolRefExpr>(Disp) && Info.OpDecl && !Info.isVarDecl()) {<br>
// Insert an explicit size if the user didn't have one.<br>
if (!Size) {<br>
Size = getPointerWidth();<br>
@@ -1397,7 +1397,7 @@ bool X86AsmParser::ParseIntelExpres<wbr>sion(<br>
if (OpKind == IOK_OFFSET)<br>
return Error(IdentLoc, "Dealing OFFSET operator as part of"<br>
"a compound immediate expression is yet to be supported");<br>
- int64_t Val = ParseIntelOperator(OpKind);<br>
+ int64_t Val = ParseIntelOperator(OpKind,SM.g<wbr>etAddImmPrefix());<br>
if (!Val)<br>
return true;<br>
StringRef ErrMsg;<br>
@@ -1407,11 +1407,38 @@ bool X86AsmParser::ParseIntelExpres<wbr>sion(<br>
PrevTK == AsmToken::RBrac) {<br>
return false;<br>
} else {<br>
- InlineAsmIdentifierInfo &Info = SM.getIdentifierInfo();<br>
- if (ParseIntelIdentifier(Val, Identifier, Info,<br>
+ InlineAsmIdentifierInfo Info;<br>
+ if (ParseIntelIdentifier(Val, Identifier, Info,<br>
/*Unevaluated=*/false, End))<br>
- return true;<br>
- SM.onIdentifierExpr(Val, Identifier);<br>
+ return true;<br>
+ // Check if the parsed identifier was a constant Integer. Here we<br>
+ // assume Val is of type MCConstantExpr only when it is safe to replace<br>
+ // the identifier with its constant value.<br>
+ if (const MCConstantExpr *CE =<br>
+ dyn_cast_or_null<const MCConstantExpr>(Val)) {<br>
+ StringRef ErrMsg;<br>
+ // Pass the enum identifier integer value to the SM calculator.<br>
+ if (SM.onInteger(CE->getValue(), ErrMsg))<br>
+ return Error(IdentLoc, ErrMsg);<br>
+ // Match the behavior of integer tokens when getAddImmPrefix flag is<br>
+ // set.<br>
+ if (SM.getAddImmPrefix()) {<br>
+ assert(isParsingInlineAsm() &&<br>
+ "Expected to be parsing inline assembly.");<br>
+ // A single rewrite of the integer value is preformed for each enum<br>
+ // identifier. This is only done when we are inside a bracketed<br>
+ // expression.<br>
+ size_t Len = End.getPointer() - IdentLoc.getPointer();<br>
+ InstInfo->AsmRewrites->emplace<wbr>_back(AOK_Imm, IdentLoc, Len,<br>
+ CE->getValue());<br>
+ break;<br>
+ }<br>
+ } else {<br>
+ // Notify the SM a variable identifier was found.<br>
+ InlineAsmIdentifierInfo &SMInfo = SM.getIdentifierInfo();<br>
+ SMInfo = Info;<br>
+ SM.onIdentifierExpr(Val, Identifier);<br>
+ }<br>
}<br>
break;<br>
}<br>
@@ -1599,6 +1626,14 @@ bool X86AsmParser::ParseIntelIdenti<wbr>fier(<br>
assert((End.getPointer() == EndPtr || !Result) &&<br>
"frontend claimed part of a token?");<br>
<br>
+ // Check if the search yielded a constant integer (enum identifier).<br>
+ if (Result && Info.isConstEnum()) {<br>
+ // By creating MCConstantExpr we let the user of Val know it is safe<br>
+ // to use as an explicit constant with value = ConstVal.<br>
+ Val = MCConstantExpr::create(Info.Co<wbr>nstIntValue.getSExtValue(),<br>
+ getParser().getContext());<br>
+ return false;<br>
+ }<br>
// If the identifier lookup was unsuccessful, assume that we are dealing with<br>
// a label.<br>
if (!Result) {<br>
@@ -1796,7 +1831,7 @@ unsigned X86AsmParser::IdentifyIntelOpe<wbr>r<br>
/// variable. A variable's size is the product of its LENGTH and TYPE. The<br>
/// TYPE operator returns the size of a C or C++ type or variable. If the<br>
/// variable is an array, TYPE returns the size of a single element.<br>
-unsigned X86AsmParser::ParseIntelOperat<wbr>or(unsigned OpKind) {<br>
+unsigned X86AsmParser::ParseIntelOperat<wbr>or(unsigned OpKind, bool AddImmPrefix) {<br>
MCAsmParser &Parser = getParser();<br>
const AsmToken &Tok = Parser.getTok();<br>
SMLoc TypeLoc = Tok.getLoc();<br>
@@ -1822,12 +1857,17 @@ unsigned X86AsmParser::ParseIntelOperat<wbr>o<br>
case IOK_SIZE: CVal = Info.Size; break;<br>
case IOK_TYPE: CVal = Info.Type; break;<br>
}<br>
-<br>
- // Rewrite the type operator and the C or C++ type or variable in terms of an<br>
- // immediate. E.g. TYPE foo -> $$4<br>
- unsigned Len = End.getPointer() - TypeLoc.getPointer();<br>
- InstInfo->AsmRewrites->emplace<wbr>_back(AOK_Imm, TypeLoc, Len, CVal);<br>
-<br>
+<br>
+ // Only when in bracketed mode, preform explicit rewrite. This is requierd to<br>
+ // avoid rewrite collision.<br>
+ if (AddImmPrefix) {<br>
+ // Rewrite the type operator and the C or C++ type or variable in terms of<br>
+ // an immediate. e.g. mov eax, [eax + SIZE _foo * $$4] -><br>
+ // mov eax, [eax + $$1 * $$4].<br>
+ unsigned Len = End.getPointer() - TypeLoc.getPointer();<br>
+ InstInfo->AsmRewrites->emplace<wbr>_back(AOK_Imm, TypeLoc, Len, CVal);<br>
+ }<br>
+<br>
return CVal;<br>
}<br>
<br>
@@ -1898,14 +1938,8 @@ std::unique_ptr<X86Operand> X86AsmParser<br>
if (SM.getSym() && SM.getSym()->getKind() == MCExpr::Constant)<br>
SM.getSym()->evaluateAsAbsolu<wbr>te(Imm);<br>
<br>
- if (StartTok.isNot(AsmToken::Iden<wbr>tifier) &&<br>
- StartTok.isNot(AsmToken::Strin<wbr>g) && isParsingInlineAsm()) {<br>
+ if (isParsingInlineAsm() && !isSymbol) {<br>
unsigned Len = Tok.getLoc().getPointer() - Start.getPointer();<br>
- if (StartTok.getString().size() == Len)<br>
- // Just add a prefix if this wasn't a complex immediate expression.<br>
- InstInfo->AsmRewrites->emplace<wbr>_back(AOK_ImmPrefix, Start);<br>
- else<br>
- // Otherwise, rewrite the complex expression as a single immediate.<br>
InstInfo->AsmRewrites->emplac<wbr>e_back(AOK_Imm, Start, Len, Imm);<br>
}<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>