From: Mike Stump Date: Tue, 14 Apr 2009 02:45:29 +0000 (+0000) Subject: Use hasAttr instead of getAttr for conditionals. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0c9083c04d9c7d7aa099813f06d339bdbb5eab9;p=clang Use hasAttr instead of getAttr for conditionals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69021 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index a1eb5c4e57..1db3b6ebc0 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -631,7 +631,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { if (VD && (VD->isBlockVarDecl() || isa(VD) || isa(VD))) { LValue LV; - bool GCable = VD->hasLocalStorage() && ! VD->getAttr(); + bool GCable = VD->hasLocalStorage() && ! VD->hasAttr(); if (VD->hasExternalStorage()) { LV = LValue::MakeAddr(CGM.GetAddrOfGlobalVar(VD), E->getType().getCVRQualifiers(), diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 73d2a5237a..7675d5a9d6 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1807,7 +1807,7 @@ bool Sema::CheckVariableDeclaration(VarDecl *NewVD, NamedDecl *PrevDecl, } if (NewVD->hasLocalStorage() && T.isObjCGCWeak() - && !NewVD->getAttr()) + && !NewVD->hasAttr()) Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local); bool isIllegalVLA = T->isVariableArrayType() && NewVD->hasGlobalStorage();