summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-04-24 21:06:20 +0000
committerAnders Carlsson <andersca@mac.com>2010-04-24 21:06:20 +0000
commitd829a02514e05c88163ae935494800b1a3c12041 (patch)
treeaf277400a34dabe441b5ab979cc0d786e15b7a25 /clang/lib/CodeGen/CGExprScalar.cpp
parentc779e995402ac3e6dc10655482b5e0be34dfa23f (diff)
downloadbcm5719-llvm-d829a02514e05c88163ae935494800b1a3c12041.tar.gz
bcm5719-llvm-d829a02514e05c88163ae935494800b1a3c12041.zip
Add a new GetAddressOfBaseClass overload that takes a base path and. Use it for derived-to-base casts.
llvm-svn: 102270
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index e1e22cef563..f38126b8e7a 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -840,15 +840,9 @@ Value *ScalarExprEmitter::EmitCastExpr(CastExpr *CE) {
CXXRecordDecl *DerivedClassDecl =
cast<CXXRecordDecl>(DerivedClassTy->getDecl());
- const RecordType *BaseClassTy =
- DestTy->getAs<PointerType>()->getPointeeType()->getAs<RecordType>();
- CXXRecordDecl *BaseClassDecl = cast<CXXRecordDecl>(BaseClassTy->getDecl());
-
- Value *Src = Visit(const_cast<Expr*>(E));
-
- bool NullCheckValue = ShouldNullCheckClassCastValue(CE);
- return CGF.GetAddressOfBaseClass(Src, DerivedClassDecl, BaseClassDecl,
- NullCheckValue);
+ return CGF.GetAddressOfBaseClass(Visit(E), DerivedClassDecl,
+ CE->getBasePath(),
+ ShouldNullCheckClassCastValue(CE));
}
case CastExpr::CK_Dynamic: {
Value *V = Visit(const_cast<Expr*>(E));
OpenPOWER on IntegriCloud