aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-07 06:22:56 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-07 06:22:56 +0000
commitf871d0cc377a1367b519a6cce26be74607566eba (patch)
treef4304b917361b0a077555fca4955eac01309d642 /lib/CodeGen/CGExprConstant.cpp
parent93a00357f2795404c6709d9e06b4f717c82e6efb (diff)
Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 4831b5dabe..61d4ac26cf 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -572,7 +572,9 @@ public:
// Check if we need to update the adjustment.
if (llvm::Constant *Offset =
- CGM.GetNonVirtualBaseClassOffset(DerivedClass, E->getBasePath())) {
+ CGM.GetNonVirtualBaseClassOffset(DerivedClass,
+ E->path_begin(),
+ E->path_end())) {
llvm::Constant *Values[2];
Values[0] = CS->getOperand(0);