diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-06 09:23:02 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-06 09:23:02 +0000 |
commit | dd5132ce2569a1ef901c92772eb8581aa1705f25 (patch) | |
tree | 7e0a88c3c6cb70271946aaa95a231b3da55d9f91 /lib/CodeGen/CGExpr.cpp | |
parent | 79ade4e028932fcb9dab15e2fb2305ca15ab0f14 (diff) | |
download | src-dd5132ce2569a1ef901c92772eb8581aa1705f25.tar.gz src-dd5132ce2569a1ef901c92772eb8581aa1705f25.zip |
Update clang to r97873.
Notes
Notes:
svn path=/vendor/clang/dist/; revision=204793
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 030d2c9c9f84..dc9ecd64f4e4 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1062,6 +1062,16 @@ static LValue EmitFunctionDeclLValue(CodeGenFunction &CGF, LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { const NamedDecl *ND = E->getDecl(); + if (ND->hasAttr<WeakRefAttr>()) { + const ValueDecl* VD = cast<ValueDecl>(ND); + llvm::Constant *Aliasee = CGM.GetWeakRefReference(VD); + + Qualifiers Quals = MakeQualifiers(E->getType()); + LValue LV = LValue::MakeAddr(Aliasee, Quals); + + return LV; + } + if (const VarDecl *VD = dyn_cast<VarDecl>(ND)) { // Check if this is a global variable. |