Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmeow committed May 15, 2023
1 parent c5a5ca4 commit 460e8a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions toolchain/lowering/lowering_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ auto LoweringHandleIntegerLiteral(LoweringContext& context,
-> void {
llvm::APInt i =
context.semantics_ir().GetIntegerLiteral(node.GetAsIntegerLiteral());
// TODO: This won't offer correct semantics, but seems close enough for now.
llvm::Value* v =
llvm::ConstantInt::get(context.builder().getInt32Ty(), i.getSExtValue());
context.SetLoweredNodeAsValue(node_id, v);
Expand All @@ -125,6 +126,7 @@ auto LoweringHandleRealLiteral(LoweringContext& context,
-> void {
SemanticsRealLiteral real =
context.semantics_ir().GetRealLiteral(node.GetAsRealLiteral());
// TODO: This will probably have overflow issues, and should be fixed.
double val =
real.mantissa.getSExtValue() *
std::pow((real.is_decimal ? 10 : 2), real.exponent.getSExtValue());
Expand Down

0 comments on commit 460e8a3

Please sign in to comment.