diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-05-23 18:36:38 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-23 18:36:38 +0000 |
commit | 414c0c43d392fab3bed731482186e0022fe4dc18 (patch) | |
tree | 9200b320dc5330c349254849806a827be0dfcb34 /lib/MC | |
parent | 01777ff0941cad56f8b5efca0b5cdd27f5df176c (diff) | |
download | external_llvm-414c0c43d392fab3bed731482186e0022fe4dc18.zip external_llvm-414c0c43d392fab3bed731482186e0022fe4dc18.tar.gz external_llvm-414c0c43d392fab3bed731482186e0022fe4dc18.tar.bz2 |
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
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 0d6eaec..4523eab 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -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; } |