Make BuildByRefType take a ValueDecl instead of a QualType and an alignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81315 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 5156d48..d180820 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -185,8 +185,7 @@
const BlockDeclRefExpr *BDRE = dyn_cast<BlockDeclRefExpr>(E);
QualType Ty = E->getType();
if (BDRE && BDRE->isByRef()) {
- uint64_t Align = getContext().getDeclAlignInBytes(BDRE->getDecl());
- Types[i+5] = llvm::PointerType::get(BuildByRefType(Ty, Align), 0);
+ Types[i+5] = llvm::PointerType::get(BuildByRefType(BDRE->getDecl()), 0);
} else
Types[i+5] = ConvertType(Ty);
}
@@ -464,9 +463,8 @@
"block.literal");
if (E->isByRef()) {
bool needsCopyDispose = BlockRequiresCopying(E->getType());
- uint64_t Align = getContext().getDeclAlignInBytes(E->getDecl());
const llvm::Type *PtrStructTy
- = llvm::PointerType::get(BuildByRefType(E->getType(), Align), 0);
+ = llvm::PointerType::get(BuildByRefType(E->getDecl()), 0);
// The block literal will need a copy/destroy helper.
BlockHasCopyDispose = true;
Ty = PtrStructTy;