diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-05-14 09:14:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-14 09:14:03 +0200 |
commit | 4554c852398d0f6e46950e9bc51f74aa1b11b29a (patch) | |
tree | 5a17d13df719d34bfca5b3fb88a17d0da6ec8f7d /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | 47c892a49136c68425e7ade08553598e63ef4e70 (diff) | |
download | llvm-4554c852398d0f6e46950e9bc51f74aa1b11b29a.zip llvm-4554c852398d0f6e46950e9bc51f74aa1b11b29a.tar.gz llvm-4554c852398d0f6e46950e9bc51f74aa1b11b29a.tar.bz2 |
[clang][bytecode] Use IsNonNull op in visitBool() (#139846)
We don't need to emit the nullptr and compare to it anymore.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Compiler.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index c7fb5e8..96ae1f5 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -4107,11 +4107,8 @@ template <class Emitter> bool Compiler<Emitter>::visitBool(const Expr *E) { return true; // Convert pointers to bool. - if (T == PT_Ptr) { - if (!this->emitNull(*T, 0, nullptr, E)) - return false; - return this->emitNE(*T, E); - } + if (T == PT_Ptr) + return this->emitIsNonNullPtr(E); // Or Floats. if (T == PT_Float) |