summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index dc8af6b68e7..80b993c89f7 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -16,7 +16,6 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SetVector.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
@@ -503,8 +502,8 @@ static const Value *stripPointerCastsAndOffsets(const Value *V) {
return V;
V = GA->getAliasee();
} else {
- if (auto CS = ImmutableCallSite(V)) {
- if (const Value *RV = CS.getReturnedArgOperand()) {
+ if (const auto *Call = dyn_cast<CallBase>(V)) {
+ if (const Value *RV = Call->getReturnedArgOperand()) {
V = RV;
continue;
}
@@ -512,9 +511,9 @@ static const Value *stripPointerCastsAndOffsets(const Value *V) {
// but it can't be marked with returned attribute, that's why it needs
// special case.
if (StripKind == PSK_ZeroIndicesAndAliasesAndInvariantGroups &&
- (CS.getIntrinsicID() == Intrinsic::launder_invariant_group ||
- CS.getIntrinsicID() == Intrinsic::strip_invariant_group)) {
- V = CS.getArgOperand(0);
+ (Call->getIntrinsicID() == Intrinsic::launder_invariant_group ||
+ Call->getIntrinsicID() == Intrinsic::strip_invariant_group)) {
+ V = Call->getArgOperand(0);
continue;
}
}
@@ -573,8 +572,8 @@ Value::stripAndAccumulateInBoundsConstantOffsets(const DataLayout &DL,
} else if (auto *GA = dyn_cast<GlobalAlias>(V)) {
V = GA->getAliasee();
} else {
- if (auto CS = ImmutableCallSite(V))
- if (const Value *RV = CS.getReturnedArgOperand()) {
+ if (const auto *Call = dyn_cast<CallBase>(V))
+ if (const Value *RV = Call->getReturnedArgOperand()) {
V = RV;
continue;
}
@@ -608,10 +607,11 @@ uint64_t Value::getPointerDereferenceableBytes(const DataLayout &DL,
DerefBytes = A->getDereferenceableOrNullBytes();
CanBeNull = true;
}
- } else if (auto CS = ImmutableCallSite(this)) {
- DerefBytes = CS.getDereferenceableBytes(AttributeList::ReturnIndex);
+ } else if (const auto *Call = dyn_cast<CallBase>(this)) {
+ DerefBytes = Call->getDereferenceableBytes(AttributeList::ReturnIndex);
if (DerefBytes == 0) {
- DerefBytes = CS.getDereferenceableOrNullBytes(AttributeList::ReturnIndex);
+ DerefBytes =
+ Call->getDereferenceableOrNullBytes(AttributeList::ReturnIndex);
CanBeNull = true;
}
} else if (const LoadInst *LI = dyn_cast<LoadInst>(this)) {
@@ -683,8 +683,8 @@ unsigned Value::getPointerAlignment(const DataLayout &DL) const {
if (AllocatedType->isSized())
Align = DL.getPrefTypeAlignment(AllocatedType);
}
- } else if (auto CS = ImmutableCallSite(this))
- Align = CS.getAttributes().getRetAlignment();
+ } else if (const auto *Call = dyn_cast<CallBase>(this))
+ Align = Call->getAttributes().getRetAlignment();
else if (const LoadInst *LI = dyn_cast<LoadInst>(this))
if (MDNode *MD = LI->getMetadata(LLVMContext::MD_align)) {
ConstantInt *CI = mdconst::extract<ConstantInt>(MD->getOperand(0));
OpenPOWER on IntegriCloud