aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2019-07-11 13:12:38 +0000
committerTim Northover <tnorthover@apple.com>2019-07-11 13:12:38 +0000
commitf2d6597653e56abfa2971c389dd9f2e469767b46 (patch)
tree56c2e523636fa1dbc8c34262a71c919fe4228b22 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent27658ed512c449db7dafcc422a674140c3851772 (diff)
downloadllvm-f2d6597653e56abfa2971c389dd9f2e469767b46.zip
llvm-f2d6597653e56abfa2971c389dd9f2e469767b46.tar.gz
llvm-f2d6597653e56abfa2971c389dd9f2e469767b46.tar.bz2
OpaquePtr: use byval accessor instead of inspecting pointer type. NFC.
The accessor can deal with both "byval(ty)" and "ty* byval" forms seamlessly. llvm-svn: 365769
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index adcb0b3..61ec292 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9491,7 +9491,7 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
unsigned PartBase = 0;
Type *FinalType = Arg.getType();
if (Arg.hasAttribute(Attribute::ByVal))
- FinalType = cast<PointerType>(FinalType)->getElementType();
+ FinalType = Arg.getParamByValType();
bool NeedsRegBlock = TLI->functionArgumentNeedsConsecutiveRegisters(
FinalType, F.getCallingConv(), F.isVarArg());
for (unsigned Value = 0, NumValues = ValueVTs.size();
@@ -9551,8 +9551,7 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
Flags.setByVal();
}
if (Flags.isByVal() || Flags.isInAlloca()) {
- PointerType *Ty = cast<PointerType>(Arg.getType());
- Type *ElementTy = Ty->getElementType();
+ Type *ElementTy = Arg.getParamByValType();
// For ByVal, size and alignment should be passed from FE. BE will
// guess if this info is not there but there are cases it cannot get