[llvm] 0960971 - [IR] Rename a couple calls to ConstantInt::getNullValue to Constant::getNullValue. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 4 10:24:51 PDT 2023
Author: Craig Topper
Date: 2023-04-04T10:24:12-07:00
New Revision: 09609715d7ebb64496ffbd3059e05a908f22cc3f
URL: https://github.com/llvm/llvm-project/commit/09609715d7ebb64496ffbd3059e05a908f22cc3f
DIFF: https://github.com/llvm/llvm-project/commit/09609715d7ebb64496ffbd3059e05a908f22cc3f.diff
LOG: [IR] Rename a couple calls to ConstantInt::getNullValue to Constant::getNullValue. NFC
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".
Added:
Modified:
llvm/include/llvm/IR/IRBuilder.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 6c50d12e74bb..7cc659721132 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -2437,12 +2437,12 @@ class IRBuilderBase {
/// 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.
More information about the llvm-commits
mailing list