aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2023-03-22 09:31:51 -0700
committerCraig Topper <craig.topper@sifive.com>2023-03-22 09:31:51 -0700
commit83e420c65f4a6c0b693af82cfd81ae58fd033f97 (patch)
tree918ab901bfca5ce082b036edf420311434f9fc27 /llvm/lib/IR/Constants.cpp
parent8eb464f5433ae65bec3536ddb1195e5ff5c46af0 (diff)
downloadllvm-83e420c65f4a6c0b693af82cfd81ae58fd033f97.zip
llvm-83e420c65f4a6c0b693af82cfd81ae58fd033f97.tar.gz
llvm-83e420c65f4a6c0b693af82cfd81ae58fd033f97.tar.bz2
[Constant] Inline ConstantInt::getSigned
ConstantInt::getSigned calls ConstantInt::get with the IsSigned flag set to true. That flag normally defaults to false. For always signed constants the code base is not consistent about whether it uses ConstantInt::getSigned or ConstantInt::get with IsSigned set to true. And it's not clear how to decide which way to use. By making getSigned inline, both ways should generate the same code in the end. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D146598
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index ba68e6b..a4b00d9 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -899,14 +899,6 @@ ConstantInt *ConstantInt::get(IntegerType *Ty, uint64_t V, bool isSigned) {
return get(Ty->getContext(), APInt(Ty->getBitWidth(), V, isSigned));
}
-ConstantInt *ConstantInt::getSigned(IntegerType *Ty, int64_t V) {
- return get(Ty, V, true);
-}
-
-Constant *ConstantInt::getSigned(Type *Ty, int64_t V) {
- return get(Ty, V, true);
-}
-
Constant *ConstantInt::get(Type *Ty, const APInt& V) {
ConstantInt *C = get(Ty->getContext(), V);
assert(C->getType() == Ty->getScalarType() &&