summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-11-18 20:18:11 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-11-18 20:18:11 +0000
commit406b117eea3b96fc13c9a2088ae305355dcf2e1e (patch)
tree78b1b697a30f531fe773d0a6a0de5de2b1828e05 /clang/lib/CodeGen/CGExpr.cpp
parent0b2732598c9beca83906644cdbb95040b7885aac (diff)
downloadbcm5719-llvm-406b117eea3b96fc13c9a2088ae305355dcf2e1e.tar.gz
bcm5719-llvm-406b117eea3b96fc13c9a2088ae305355dcf2e1e.zip
Some basic support toward objective-c's GC code gen.
llvm-svn: 59543
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 5f5001732cd..993562592b6 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -492,8 +492,14 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
return LValue::MakeAddr(V, E->getType().getCVRQualifiers());
}
} else if (VD && VD->isFileVarDecl()) {
- return LValue::MakeAddr(CGM.GetAddrOfGlobalVar(VD),
- E->getType().getCVRQualifiers());
+ LValue LV = LValue::MakeAddr(CGM.GetAddrOfGlobalVar(VD),
+ E->getType().getCVRQualifiers());
+ if (VD->getAttr<ObjCGCAttr>())
+ {
+ ObjCGCAttr::GCAttrTypes attrType = (VD->getAttr<ObjCGCAttr>())->getType();
+ LValue::SetObjCGCAttrs(attrType == ObjCGCAttr::Weak, attrType == ObjCGCAttr::Strong, LV);
+ }
+ return LV;
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(E->getDecl())) {
return LValue::MakeAddr(CGM.GetAddrOfFunction(FD),
E->getType().getCVRQualifiers());
OpenPOWER on IntegriCloud