From 2d63faead4e6339e679ab62113f47112d67a5b06 Mon Sep 17 00:00:00 2001 From: Timm Baeder Date: Wed, 16 Apr 2025 13:21:25 +0200 Subject: [clang][bytecode][NFC] Remove PT_FnPtr (#135947) We don't need this anymore since we don't return it from classify() anymore. --- clang/lib/AST/ByteCode/Compiler.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'clang/lib/AST/ByteCode/Compiler.cpp') diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index afd8d09..157e306 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -4057,7 +4057,7 @@ template bool Compiler::visitBool(const Expr *E) { return true; // Convert pointers to bool. - if (T == PT_Ptr || T == PT_FnPtr) { + if (T == PT_Ptr) { if (!this->emitNull(*T, 0, nullptr, E)) return false; return this->emitNE(*T, E); @@ -4103,8 +4103,6 @@ bool Compiler::visitZeroInitializer(PrimType T, QualType QT, case PT_Ptr: return this->emitNullPtr(Ctx.getASTContext().getTargetNullPointerValue(QT), nullptr, E); - case PT_FnPtr: - return this->emitNullFnPtr(0, nullptr, E); case PT_MemberPtr: return this->emitNullMemberPtr(0, nullptr, E); case PT_Float: @@ -4255,7 +4253,6 @@ bool Compiler::emitConst(T Value, PrimType Ty, const Expr *E) { case PT_Bool: return this->emitConstBool(Value, E); case PT_Ptr: - case PT_FnPtr: case PT_MemberPtr: case PT_Float: case PT_IntAP: @@ -4956,7 +4953,7 @@ bool Compiler::VisitCallExpr(const CallExpr *E) { // If we know the callee already, check the known parametrs for nullability. if (FuncDecl && NonNullArgs[ArgIndex]) { PrimType ArgT = classify(Arg).value_or(PT_Ptr); - if (ArgT == PT_Ptr || ArgT == PT_FnPtr) { + if (ArgT == PT_Ptr) { if (!this->emitCheckNonNullArg(ArgT, Arg)) return false; } @@ -5997,7 +5994,7 @@ bool Compiler::VisitUnaryOperator(const UnaryOperator *E) { if (!this->visit(SubExpr)) return false; - if (T == PT_Ptr || T == PT_FnPtr) { + if (T == PT_Ptr) { if (!this->emitIncPtr(E)) return false; @@ -6021,7 +6018,7 @@ bool Compiler::VisitUnaryOperator(const UnaryOperator *E) { if (!this->visit(SubExpr)) return false; - if (T == PT_Ptr || T == PT_FnPtr) { + if (T == PT_Ptr) { if (!this->emitDecPtr(E)) return false; @@ -6045,7 +6042,7 @@ bool Compiler::VisitUnaryOperator(const UnaryOperator *E) { if (!this->visit(SubExpr)) return false; - if (T == PT_Ptr || T == PT_FnPtr) { + if (T == PT_Ptr) { if (!this->emitLoadPtr(E)) return false; if (!this->emitConstUint8(1, E)) @@ -6088,7 +6085,7 @@ bool Compiler::VisitUnaryOperator(const UnaryOperator *E) { if (!this->visit(SubExpr)) return false; - if (T == PT_Ptr || T == PT_FnPtr) { + if (T == PT_Ptr) { if (!this->emitLoadPtr(E)) return false; if (!this->emitConstUint8(1, E)) -- cgit v1.1