[llvm-branch-commits] [llvm-branch] r104501 - /llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
Daniel Dunbar
daniel at zuster.org
Mon May 24 08:17:48 PDT 2010
Author: ddunbar
Date: Mon May 24 10:17:47 2010
New Revision: 104501
URL: http://llvm.org/viewvc/llvm-project?rev=104501&view=rev
Log:
llvm-mc: Use EmitIntValue where possible, which makes the API calls from the AsmParser and CodeGen line up better.
Modified:
llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
Modified: llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp?rev=104501&r1=104500&r2=104501&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp Mon May 24 10:17:47 2010
@@ -1083,7 +1083,11 @@
if (ParseExpression(Value))
return true;
- Out.EmitValue(Value, Size, DEFAULT_ADDRSPACE);
+ // Special case constant expressions to match code generator.
+ if (const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(Value))
+ Out.EmitIntValue(MCE->getValue(), Size, DEFAULT_ADDRSPACE);
+ else
+ Out.EmitValue(Value, Size, DEFAULT_ADDRSPACE);
if (Lexer.is(AsmToken::EndOfStatement))
break;
@@ -1165,8 +1169,7 @@
return TokError("invalid '.fill' size, expected 1, 2, 4, or 8");
for (uint64_t i = 0, e = NumValues; i != e; ++i)
- Out.EmitValue(MCConstantExpr::Create(FillExpr, getContext()), FillSize,
- DEFAULT_ADDRSPACE);
+ Out.EmitIntValue(FillExpr, FillSize, DEFAULT_ADDRSPACE);
return false;
}
More information about the llvm-branch-commits
mailing list