diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-14 01:29:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-14 01:29:45 +0000 |
commit | d2d2a11a91d7ddf468bfb70f66362d24806ed601 (patch) | |
tree | 1920f1ccb6fc00b05bbd9d884dd821601d906626 /CodeGen/CGExpr.cpp | |
parent | 8f32f7189b12f67aa4a19bc7c3855b599980eca0 (diff) |
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
Diffstat (limited to 'CodeGen/CGExpr.cpp')
-rw-r--r-- | CodeGen/CGExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index 9f535b5352..0b1ac8fc79 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -1168,7 +1168,8 @@ RValue CodeGenFunction::EmitPointerSub(RValue LHS, QualType LHSTy, 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"); |