From 5808ce43f8d7e71f5acacc9ca320268c4f37565a Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 3 Feb 2011 08:15:49 +0000 Subject: More capturing of 'this': implicit member expressions. Getting that right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124785 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 8bac4c0b02..2108e21ed3 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1178,24 +1178,10 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { setObjCGCLValueClass(getContext(), E, LV); return LV; } - - // If we're emitting an instance method as an independent lvalue, - // we're actually emitting a member pointer. - if (const CXXMethodDecl *MD = dyn_cast(ND)) - if (MD->isInstance()) { - llvm::Value *V = CGM.getCXXABI().EmitMemberPointer(MD); - return MakeAddrLValue(V, MD->getType(), Alignment); - } - if (const FunctionDecl *FD = dyn_cast(ND)) - return EmitFunctionDeclLValue(*this, E, FD); - - // If we're emitting a field as an independent lvalue, we're - // actually emitting a member pointer. - if (const FieldDecl *FD = dyn_cast(ND)) { - llvm::Value *V = CGM.getCXXABI().EmitMemberPointer(FD); - return MakeAddrLValue(V, FD->getType(), Alignment); - } - + + if (const FunctionDecl *fn = dyn_cast(ND)) + return EmitFunctionDeclLValue(*this, E, fn); + assert(false && "Unhandled DeclRefExpr"); // an invalid LValue, but the assert will -- cgit v1.2.3