diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-04-16 13:21:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-16 13:21:25 +0200 |
commit | 2d63faead4e6339e679ab62113f47112d67a5b06 (patch) | |
tree | aecc1c192d59922469337f1ef7b64b1b0fc8d210 /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | 1e61b374ba3ba2891dc1abda732b0b9263216785 (diff) | |
download | llvm-2d63faead4e6339e679ab62113f47112d67a5b06.zip llvm-2d63faead4e6339e679ab62113f47112d67a5b06.tar.gz llvm-2d63faead4e6339e679ab62113f47112d67a5b06.tar.bz2 |
[clang][bytecode][NFC] Remove PT_FnPtr (#135947)
We don't need this anymore since we don't return it from classify()
anymore.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Compiler.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
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 <class Emitter> bool Compiler<Emitter>::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<Emitter>::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<Emitter>::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<Emitter>::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<Emitter>::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<Emitter>::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<Emitter>::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<Emitter>::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)) |