aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-05-26 20:32:04 -0700
committerArthur Eubanks <aeubanks@google.com>2021-05-31 09:54:57 -0700
commit2c3afa32377693514e400aee10f27b691887b4cf (patch)
treebc1dbf36094e54522a498350411c3200c32bcce0 /llvm/lib/CodeGen/SafeStack.cpp
parent116179c2ee5213f2ae8f07a400ac98f0c995b3d3 (diff)
downloadllvm-2c3afa32377693514e400aee10f27b691887b4cf.zip
llvm-2c3afa32377693514e400aee10f27b691887b4cf.tar.gz
llvm-2c3afa32377693514e400aee10f27b691887b4cf.tar.bz2
[OpaquePtr] Clean up some uses of Type::getPointerElementType()
These depend on pointee types.
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r--llvm/lib/CodeGen/SafeStack.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp
index e097843d..94add92 100644
--- a/llvm/lib/CodeGen/SafeStack.cpp
+++ b/llvm/lib/CodeGen/SafeStack.cpp
@@ -425,8 +425,7 @@ void SafeStack::findInsts(Function &F,
for (Argument &Arg : F.args()) {
if (!Arg.hasByValAttr())
continue;
- uint64_t Size =
- DL.getTypeStoreSize(Arg.getType()->getPointerElementType());
+ uint64_t Size = DL.getTypeStoreSize(Arg.getParamByValType());
if (IsSafeStackAlloca(&Arg, Size))
continue;
@@ -527,7 +526,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack(
}
for (Argument *Arg : ByValArguments) {
- Type *Ty = Arg->getType()->getPointerElementType();
+ Type *Ty = Arg->getParamByValType();
uint64_t Size = DL.getTypeStoreSize(Ty);
if (Size == 0)
Size = 1; // Don't create zero-sized stack objects.
@@ -584,7 +583,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack(
for (Argument *Arg : ByValArguments) {
unsigned Offset = SSL.getObjectOffset(Arg);
MaybeAlign Align(SSL.getObjectAlignment(Arg));
- Type *Ty = Arg->getType()->getPointerElementType();
+ Type *Ty = Arg->getParamByValType();
uint64_t Size = DL.getTypeStoreSize(Ty);
if (Size == 0)