summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-03-06 09:23:02 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-03-06 09:23:02 +0000
commitd2e6cf1d1c6468396ec057119c32aa58b1ee5ac9 (patch)
tree7e0a88c3c6cb70271946aaa95a231b3da55d9f91 /lib/CodeGen/CGExpr.cpp
parentdf90325d4c0a65ee64d2dae3ed9b5b34f7418533 (diff)
downloadFreeBSD-src-d2e6cf1d1c6468396ec057119c32aa58b1ee5ac9.zip
FreeBSD-src-d2e6cf1d1c6468396ec057119c32aa58b1ee5ac9.tar.gz
Update clang to r97873.
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 030d2c9..dc9ecd6 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.
OpenPOWER on IntegriCloud