diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-18 20:18:11 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-18 20:18:11 +0000 |
commit | 406b117eea3b96fc13c9a2088ae305355dcf2e1e (patch) | |
tree | 78b1b697a30f531fe773d0a6a0de5de2b1828e05 /clang/lib/CodeGen/CGExpr.cpp | |
parent | 0b2732598c9beca83906644cdbb95040b7885aac (diff) | |
download | bcm5719-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.cpp | 10 |
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()); |