aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-07 22:00:15 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-07 22:00:15 +0000
commit909fbf70223ea04a5ec8d449789f3683a89701ff (patch)
tree2ad537ab910af30e8c7287a07cd5a28e39c49a46 /lib/CodeGen/CGExpr.cpp
parent36a862f1d6810e05121d5be1b6458bd11b69e495 (diff)
Change EmitPointerToDataMemberLValue to take a FieldDecl. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index d9dd70ac9e..62e16e8ba2 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -884,7 +884,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
if (E->getQualifier()) {
// FIXME: the qualifier check does not seem sufficient here
- return EmitPointerToDataMemberLValue(E);
+ return EmitPointerToDataMemberLValue(cast<FieldDecl>(E->getDecl()));
}
assert(0 && "Unimp declref");
@@ -1526,8 +1526,7 @@ LValue CodeGenFunction::EmitStmtExprLValue(const StmtExpr *E) {
}
-LValue CodeGenFunction::EmitPointerToDataMemberLValue(const DeclRefExpr *E) {
- const FieldDecl *Field = cast<FieldDecl>(E->getDecl());
+LValue CodeGenFunction::EmitPointerToDataMemberLValue(const FieldDecl *Field) {
const CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(Field->getDeclContext());
QualType NNSpecTy =
getContext().getCanonicalType(
@@ -1538,7 +1537,7 @@ LValue CodeGenFunction::EmitPointerToDataMemberLValue(const DeclRefExpr *E) {
/*isUnion*/false, /*Qualifiers*/0);
const llvm::Type *ResultType = ConvertType(getContext().getPointerDiffType());
V = Builder.CreatePtrToInt(MemExpLV.getAddress(), ResultType, "datamember");
- return LValue::MakeAddr(V, MakeQualifiers(E->getType()));
+ return LValue::MakeAddr(V, MakeQualifiers(Field->getType()));
}
RValue CodeGenFunction::EmitCall(llvm::Value *Callee, QualType CalleeType,