aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2020-04-02 15:10:30 +0000
committerGuillaume Chatelet <gchatelet@google.com>2020-04-03 13:21:58 +0000
commit9068bccbae340c4b281ad92ba041a934de39fac3 (patch)
tree8d92fe7b03f1a5e7930a05291421fffef7d41aee /llvm/lib/IR/Value.cpp
parent5e426363ba4bd7b5e298be2b2ee4634e7abe7083 (diff)
downloadllvm-9068bccbae340c4b281ad92ba041a934de39fac3.zip
llvm-9068bccbae340c4b281ad92ba041a934de39fac3.tar.gz
llvm-9068bccbae340c4b281ad92ba041a934de39fac3.tar.bz2
[Alignment][NFC] Deprecate InstrTypes getRetAlignment/getParamAlignment
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77312
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 962e674..afb509f 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -746,22 +746,22 @@ MaybeAlign Value::getPointerAlignment(const DataLayout &DL) const {
if (GVar->isStrongDefinitionForLinker())
return MaybeAlign(DL.getPreferredAlignment(GVar));
else
- return Align(DL.getABITypeAlignment(ObjectType));
+ return DL.getABITypeAlign(ObjectType);
}
}
}
return Alignment;
} else if (const Argument *A = dyn_cast<Argument>(this)) {
- const MaybeAlign Alignment(A->getParamAlignment());
+ const MaybeAlign Alignment = A->getParamAlign();
if (!Alignment && A->hasStructRetAttr()) {
// An sret parameter has at least the ABI alignment of the return type.
Type *EltTy = cast<PointerType>(A->getType())->getElementType();
if (EltTy->isSized())
- return Align(DL.getABITypeAlignment(EltTy));
+ return DL.getABITypeAlign(EltTy);
}
return Alignment;
} else if (const AllocaInst *AI = dyn_cast<AllocaInst>(this)) {
- const MaybeAlign Alignment(AI->getAlignment());
+ const MaybeAlign Alignment = AI->getAlign();
if (!Alignment) {
Type *AllocatedType = AI->getAllocatedType();
if (AllocatedType->isSized())
@@ -769,7 +769,7 @@ MaybeAlign Value::getPointerAlignment(const DataLayout &DL) const {
}
return Alignment;
} else if (const auto *Call = dyn_cast<CallBase>(this)) {
- const MaybeAlign Alignment(Call->getRetAlignment());
+ const MaybeAlign Alignment = Call->getRetAlign();
if (!Alignment && Call->getCalledFunction())
return MaybeAlign(
Call->getCalledFunction()->getAttributes().getRetAlignment());