]> granicus.if.org Git - clang/commitdiff
Use hasAttr instead of getAttr for conditionals.
authorMike Stump <mrs@apple.com>
Tue, 14 Apr 2009 02:45:29 +0000 (02:45 +0000)
committerMike Stump <mrs@apple.com>
Tue, 14 Apr 2009 02:45:29 +0000 (02:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69021 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp
lib/Sema/SemaDecl.cpp

index a1eb5c4e5779f45cd2af3a5f17723ab3dcd2d84c..1db3b6ebc06e530549a200a1238e5335a2952e70 100644 (file)
@@ -631,7 +631,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
   if (VD && (VD->isBlockVarDecl() || isa<ParmVarDecl>(VD) ||
         isa<ImplicitParamDecl>(VD))) {
     LValue LV;
-    bool GCable = VD->hasLocalStorage() && ! VD->getAttr<BlocksAttr>();
+    bool GCable = VD->hasLocalStorage() && ! VD->hasAttr<BlocksAttr>();
     if (VD->hasExternalStorage()) {
       LV = LValue::MakeAddr(CGM.GetAddrOfGlobalVar(VD),
                             E->getType().getCVRQualifiers(),
index 73d2a5237aa73737d73b9d684d6a6bfb3c4d39cf..7675d5a9d6908b20de4e432de6e9c4832c790058 100644 (file)
@@ -1807,7 +1807,7 @@ bool Sema::CheckVariableDeclaration(VarDecl *NewVD, NamedDecl *PrevDecl,
   }
 
   if (NewVD->hasLocalStorage() && T.isObjCGCWeak()
-      && !NewVD->getAttr<BlocksAttr>())
+      && !NewVD->hasAttr<BlocksAttr>())
     Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local);
 
   bool isIllegalVLA = T->isVariableArrayType() && NewVD->hasGlobalStorage();