mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +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,7 +1083,11 @@ bool AsmParser::ParseDirectiveValue(unsigned Size) {
|
||||
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 @@ 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