true and false support, and lowering for bool type. (#2896)

This commit is contained in:
Richard Smith
2023-06-13 16:43:03 -07:00
committed by GitHub
parent 8e940d9724
commit aa40e2b8a9
15 changed files with 198 additions and 5 deletions
+4
View File
@@ -141,6 +141,10 @@ auto LoweringContext::BuildType(SemanticsNodeId node_id) -> llvm::Type* {
case SemanticsBuiltinKind::IntegerType.AsInt():
// TODO: Handle different sizes.
return builder_.getInt32Ty();
case SemanticsBuiltinKind::BoolType.AsInt():
// TODO: We may want to have different representations for `bool` storage
// (`i8`) versus for `bool` values (`i1`).
return builder_.getInt1Ty();
}
auto node = semantics_ir_->GetNode(node_id);