diff options
Diffstat (limited to 'clang/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/CodeGen/CGExpr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/CodeGen/CGExpr.cpp b/clang/CodeGen/CGExpr.cpp index 63879ad66be..e6aaff15d55 100644 --- a/clang/CodeGen/CGExpr.cpp +++ b/clang/CodeGen/CGExpr.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "CodeGenFunction.h" +#include "CodeGenModule.h" #include "clang/AST/AST.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" @@ -261,6 +262,8 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { llvm::Value *V = LocalDeclMap[D]; assert(V && "BlockVarDecl not entered in LocalDeclMap?"); return LValue::getAddr(V); + } else if (isa<FunctionDecl>(D) || isa<FileVarDecl>(D)) { + return LValue::getAddr(CGM.GetAddrOfGlobalDecl(D)); } assert(0 && "Unimp declref"); } |