Skip to content

Commit 4554c85

Browse files
authored
[clang][bytecode] Use IsNonNull op in visitBool() (#139846)
We don't need to emit the nullptr and compare to it anymore.
1 parent 47c892a commit 4554c85

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4107,11 +4107,8 @@ template <class Emitter> bool Compiler<Emitter>::visitBool(const Expr *E) {
41074107
return true;
41084108

41094109
// Convert pointers to bool.
4110-
if (T == PT_Ptr) {
4111-
if (!this->emitNull(*T, 0, nullptr, E))
4112-
return false;
4113-
return this->emitNE(*T, E);
4114-
}
4110+
if (T == PT_Ptr)
4111+
return this->emitIsNonNullPtr(E);
41154112

41164113
// Or Floats.
41174114
if (T == PT_Float)

0 commit comments

Comments
 (0)