Skip to content

Commit

Permalink
feat: Added null pointer representation
Browse files Browse the repository at this point in the history
  • Loading branch information
alinalihassan committed May 27, 2022
1 parent ce4ea17 commit 5a8fb9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/liblesma/Backend/Codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,8 @@ llvm::Value *Codegen::visit(Literal *node) {
return ConstantInt::getBool(*TheContext, node->getValue() == "true");
else if (node->getType() == TokenType::STRING)
return Builder->CreateGlobalStringPtr(node->getValue());
else if (node->getType() == TokenType::NIL)
return ConstantPointerNull::get(PointerType::get(*TheContext, 0));
else if (node->getType() == TokenType::IDENTIFIER) {
// Look this variable up in the function.
auto val = Scope->lookup(node->getValue());
Expand Down

0 comments on commit 5a8fb9c

Please sign in to comment.