mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
llvm-mc: Use EmitIntValue where possible, which makes the API calls from the AsmParser and CodeGen line up better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
01777ff094
commit
414c0c43d3
@ -1083,6 +1083,10 @@ bool AsmParser::ParseDirectiveValue(unsigned Size) {
|
||||
if (ParseExpression(Value))
|
||||
return true;
|
||||
|
||||
// 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))
|
||||
@ -1165,8 +1169,7 @@ bool AsmParser::ParseDirectiveFill() {
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user