mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-01 08:47:42 +00:00
Add support for parsing a Real value. It stores the Real value as its binary
encoding. It's up to the individual back-ends to convert it to their preferred representation when printing. llvm-svn: 124229
This commit is contained in:
parent
29e8317caa
commit
195d8c3988
@ -563,6 +563,13 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case AsmToken::Real: {
|
||||
APFloat RealVal(APFloat::IEEEdouble, getTok().getString());
|
||||
int64_t IntVal = RealVal.bitcastToAPInt().getSExtValue();
|
||||
Res = MCConstantExpr::Create(IntVal, getContext());
|
||||
Lex(); // Eat token.
|
||||
return false;
|
||||
}
|
||||
case AsmToken::Dot: {
|
||||
// This is a '.' reference, which references the current PC. Emit a
|
||||
// temporary label to the streamer and refer to it.
|
||||
@ -573,7 +580,6 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
Lex(); // Eat identifier.
|
||||
return false;
|
||||
}
|
||||
|
||||
case AsmToken::LParen:
|
||||
Lex(); // Eat the '('.
|
||||
return ParseParenExpr(Res, EndLoc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user