[IR] Rename a couple calls to ConstantInt::getNullValue to Constant::getNullValue...
authorCraig Topper <craig.topper@sifive.com>
Tue, 4 Apr 2023 17:22:44 +0000 (10:22 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 4 Apr 2023 17:24:12 +0000 (10:24 -0700)
There is no getNullValue in ConstantInt. Due to inheritance, it's
really Constant::getNullValue.

Most of the calls in tree that use ConstantInt::getNullValue do
know the type is an integer. These two calls allow pointers so
shouldn't use "ConstantInt".

llvm/include/llvm/IR/IRBuilder.h

index 6c50d12..7cc6597 100644 (file)
@@ -2437,12 +2437,12 @@ public:
 
   /// Return a boolean value testing if \p Arg == 0.
   Value *CreateIsNull(Value *Arg, const Twine &Name = "") {
-    return CreateICmpEQ(Arg, ConstantInt::getNullValue(Arg->getType()), Name);
+    return CreateICmpEQ(Arg, Constant::getNullValue(Arg->getType()), Name);
   }
 
   /// Return a boolean value testing if \p Arg != 0.
   Value *CreateIsNotNull(Value *Arg, const Twine &Name = "") {
-    return CreateICmpNE(Arg, ConstantInt::getNullValue(Arg->getType()), Name);
+    return CreateICmpNE(Arg, Constant::getNullValue(Arg->getType()), Name);
   }
 
   /// Return a boolean value testing if \p Arg < 0.