From: Fariborz Jahanian Date: Thu, 13 Jan 2011 21:35:27 +0000 (+0000) Subject: Save getObjCGCAttrKind and use it in two places X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0990b00ba0627d76d53432afe729041ca3f4579b;p=clang Save getObjCGCAttrKind and use it in two places for efficiancy (still part of //rdar://8761767). Per John's comment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123401 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index d7b97b7ac2..10b307365c 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -2065,7 +2065,6 @@ isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index 84e03446f6..8b2d6f5e66 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -36,10 +36,11 @@ static void EmitDeclInit(CodeGenFunction &CGF, const VarDecl &D, if (!CGF.hasAggregateLLVMType(T)) { llvm::Value *V = CGF.EmitScalarExpr(Init); CodeGenModule &CGM = CGF.CGM; - if (CGF.getContext().getObjCGCAttrKind(T) == Qualifiers::Strong) + Qualifiers::GC GCAttr = CGM.getContext().getObjCGCAttrKind(T); + if (GCAttr == Qualifiers::Strong) CGM.getObjCRuntime().EmitObjCGlobalAssign(CGF, V, DeclPtr, D.isThreadSpecified()); - else if (CGF.getContext().getObjCGCAttrKind(T) == Qualifiers::Weak) + else if (GCAttr == Qualifiers::Weak) CGM.getObjCRuntime().EmitObjCWeakAssign(CGF, V, DeclPtr); else CGF.EmitStoreOfScalar(V, DeclPtr, isVolatile, Alignment, T);