aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-03-16 10:34:18 +0100
committerNikita Popov <npopov@redhat.com>2023-03-16 10:35:11 +0100
commitd7144df63718e8d882f53400b2e54e0ed67c23a4 (patch)
tree44e5b931bb1c50c9dde9b2268c3a86ad47593691 /llvm/lib/IR/Constants.cpp
parentbbfb13a5ffbccf1759ca6b75262a3ffdbe20496e (diff)
downloadllvm-d7144df63718e8d882f53400b2e54e0ed67c23a4.zip
llvm-d7144df63718e8d882f53400b2e54e0ed67c23a4.tar.gz
llvm-d7144df63718e8d882f53400b2e54e0ed67c23a4.tar.bz2
[IR] Remove unused ConstantExpr::getOffsetOf() methods (NFC)
These are not used and should not be used (just like anything that creates a constant expression only due to lack of DL-awareness).
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 51ad3a12..ba68e6b 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2397,24 +2397,6 @@ Constant *ConstantExpr::getAlignOf(Type* Ty) {
Type::getInt64Ty(Ty->getContext()));
}
-Constant *ConstantExpr::getOffsetOf(StructType* STy, unsigned FieldNo) {
- return getOffsetOf(STy, ConstantInt::get(Type::getInt32Ty(STy->getContext()),
- FieldNo));
-}
-
-Constant *ConstantExpr::getOffsetOf(Type* Ty, Constant *FieldNo) {
- // offsetof is implemented as: (i64) gep (Ty*)null, 0, FieldNo
- // Note that a non-inbounds gep is used, as null isn't within any object.
- Constant *GEPIdx[] = {
- ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0),
- FieldNo
- };
- Constant *GEP = getGetElementPtr(
- Ty, Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx);
- return getPtrToInt(GEP,
- Type::getInt64Ty(Ty->getContext()));
-}
-
Constant *ConstantExpr::getCompare(unsigned short Predicate, Constant *C1,
Constant *C2, bool OnlyIfReduced) {
assert(C1->getType() == C2->getType() && "Op types should be identical!");