@@ -227,12 +227,12 @@ fn QualType Analyser.checkBinopShiftArgs(Analyser* ma, BinaryOperator* b, QualTy
227227
228228 // perform integer promotion on both arguments
229229 if (bl.isPromotableIntegerType()) {
230- lcanon = ast.builtins[BuiltinKind. Int32] ;
230+ lcanon = getBuiltinQT( Int32) ;
231231 width = 32;
232232 if (!assign) ma.builder.insertImplicitCast(IntegralCast, b.getLHS2(), lcanon);
233233 }
234234 if (br.isPromotableIntegerType()) {
235- rcanon = ast.builtins[BuiltinKind. Int32] ;
235+ rcanon = getBuiltinQT( Int32) ;
236236 ma.builder.insertImplicitCast(IntegralCast, b.getRHS2(), rcanon);
237237 }
238238 Expr* lhs = b.getLHS();
@@ -269,7 +269,7 @@ fn QualType Analyser.checkBinopLogical(Analyser* ma, BinaryOperator* b, QualType
269269 }
270270 if (!validTestType(rhs)) return ma.invalidBinOp1(b, b.getRHS(), rhs);
271271
272- return builtins[BuiltinKind. Bool] ;
272+ return getBuiltinQT( Bool) ;
273273}
274274
275275// 0 cannot happen
@@ -514,7 +514,7 @@ fn QualType Analyser.checkBinopSubArgs(Analyser* ma, BinaryOperator* b, QualType
514514 QualType t1 = pt1.getInner();
515515 QualType t2 = pt2.getInner();
516516 if (t1.getTypeOrNil() != t2.getTypeOrNil() || t1.isVoid() || t2.isVoid()) goto invalid;
517- return builtins[BuiltinKind. ISize] ;
517+ return getBuiltinQT( ISize) ;
518518 }
519519 return ma.invalidBinOp2(b, lhs, rhs);
520520}
@@ -582,7 +582,7 @@ fn QualType Analyser.checkBinopComparison(Analyser* ma, BinaryOperator* b, QualT
582582 // TODO should detect comparison between i32/u32 and i32/u32
583583 // TODO i32 < u32 is not the same as i32 = u32! dont use checker
584584 //if (ma.checker.check(lhs, rhs, &e, e.getLoc())) return QualType_Invalid;
585- return builtins[BuiltinKind. Bool] ;
585+ return getBuiltinQT( Bool) ;
586586 case 3: // builtin : enum
587587 rcanon = rcanon.getImplType();
588588 goto builtin;
@@ -598,7 +598,7 @@ fn QualType Analyser.checkBinopComparison(Analyser* ma, BinaryOperator* b, QualT
598598 ma.error(e.getLoc(), "comparing pointers to different types ('%s' and '%s')", lhs.diagName(), rhs.diagName());
599599 return QualType_Invalid;
600600 }
601- return builtins[BuiltinKind. Bool] ;
601+ return getBuiltinQT( Bool) ;
602602 case 5: // enum : builtin
603603 lcanon = lcanon.getImplType();
604604 goto builtin;
@@ -607,7 +607,7 @@ fn QualType Analyser.checkBinopComparison(Analyser* ma, BinaryOperator* b, QualT
607607 ma.error(e.getLoc(), "comparing enums of different types ('%s' and '%s')", lhs.diagName(), rhs.diagName());
608608 return QualType_Invalid;
609609 }
610- return builtins[BuiltinKind. Bool] ;
610+ return getBuiltinQT( Bool) ;
611611 case 7: // pointer : function
612612 if (is_relative) return ma.invalidFuncCompare(b);
613613 // TODO accept 0 == f, (void*)0 == f and (void*)nil == f
@@ -620,7 +620,7 @@ fn QualType Analyser.checkBinopComparison(Analyser* ma, BinaryOperator* b, QualT
620620 return ma.checkFuncTest(lcanon.getFunctionType(), e.getLoc());
621621 case 9: // function : function
622622 if (is_relative) return ma.invalidFuncCompare(b);
623- return builtins[BuiltinKind. Bool] ;
623+ return getBuiltinQT( Bool) ;
624624 case 10: // invalid lhs
625625 invalid_lhs:
626626 if (rcanon.isVoid()) goto invalid;
@@ -638,7 +638,7 @@ fn QualType Analyser.checkBinopComparison(Analyser* ma, BinaryOperator* b, QualT
638638fn QualType Analyser.checkFuncTest(Analyser* ma, FunctionType* ft, SrcLoc loc) {
639639 // only allow nil vs weak-function or function pointer
640640 FunctionDecl* fd = ft.getDecl();
641- if (fd.isType() || fd.hasAttrWeak()) return builtins[BuiltinKind. Bool] ; // Variable with Function type (eg callback)
641+ if (fd.isType() || fd.hasAttrWeak()) return getBuiltinQT( Bool) ; // Variable with Function type (eg callback)
642642 ma.error(loc, "comparison of function '%s' will always be true", fd.asDecl().getFullName());
643643 return QualType_Invalid;
644644}
@@ -686,7 +686,7 @@ fn QualType Analyser.analyseBinaryOperator(Analyser* ma, Expr** e_ptr) {
686686 if (opcode.isComparison()) {
687687 // special case for enum comparison without prefix (eg kind >= KW_void)
688688 if (ma.checkEnumArg(b.getRHS2(), ltype))
689- return builtins[BuiltinKind. Bool] ;
689+ return getBuiltinQT( Bool) ;
690690 }
691691 QualType rtype;
692692 if (opcode == BinaryOpcode.Assign) {
0 commit comments