aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2020-09-23 11:03:38 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2020-09-24 09:57:28 -0400
commitd65a7003c435de22b8e30dca292160fea822d887 (patch)
tree15c19f658c4880ea6c867ebb88476bb2831d8fe4 /llvm/lib/IR/Value.cpp
parent8f72717ebe27209a11be80629c667332cd5e4e60 (diff)
downloadllvm-d65a7003c435de22b8e30dca292160fea822d887.zip
llvm-d65a7003c435de22b8e30dca292160fea822d887.tar.gz
llvm-d65a7003c435de22b8e30dca292160fea822d887.tar.bz2
OpaquePtr: Add helpers for sret to mirror byval
Sret should really have a type parameter like byval does.
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 1ef3360..545404f 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -804,7 +804,7 @@ Align Value::getPointerAlignment(const DataLayout &DL) const {
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();
+ Type *EltTy = A->getParamStructRetType();
if (EltTy->isSized())
return DL.getABITypeAlign(EltTy);
}