A significant refactoring of the type size stuff to also
compute type alignment. This info is needed for struct layout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp
index 9f535b5..0b1ac8f 100644
--- a/CodeGen/CGExpr.cpp
+++ b/CodeGen/CGExpr.cpp
@@ -1168,7 +1168,8 @@
QualType LHSElementType = LHSPtrType->getPointeeType();
assert(LHSElementType == RHSPtrType->getPointeeType() &&
"can't subtract pointers with differing element types");
- unsigned ElementSize = getContext().getTypeSize(LHSElementType) / 8;
+ unsigned ElementSize = getContext().getTypeSize(LHSElementType,
+ SourceLocation()) / 8;
const llvm::Type *ResultType = ConvertType(ResTy);
llvm::Value *CastLHS = Builder.CreatePtrToInt(LHSValue, ResultType,
"sub.ptr.lhs.cast");