summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-01-13 21:35:27 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-01-13 21:35:27 +0000
commitf59e80e0ed35679cbe80546a69f8f8f44a1eb03a (patch)
treee3378f192abde64c605f0b6d51dc75b3094ccd4d /clang/lib/CodeGen
parent05a0b55e76a33f604c1e28d2b4ff3cfdca927ad2 (diff)
downloadbcm5719-llvm-f59e80e0ed35679cbe80546a69f8f8f44a1eb03a.tar.gz
bcm5719-llvm-f59e80e0ed35679cbe80546a69f8f8f44a1eb03a.zip
Save getObjCGCAttrKind and use it in two places
for efficiancy (still part of //rdar://8761767). Per John's comment. llvm-svn: 123401
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDeclCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index 84e03446f66..8b2d6f5e669 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud