Use hasAttr instead of getAttr for conditionals.

llvm-svn: 69021
This commit is contained in:
Mike Stump 2009-04-14 02:45:29 +00:00
parent 0ca1660129
commit 4c0dc0e48a
2 changed files with 2 additions and 2 deletions

View 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(),

View 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();