Fix some dead stores which the static analyzer warned about. No functionality

change (the problematic cases in ParseDecl.cpp are currently impossible).

llvm-svn: 163920
This commit is contained in:
Richard Smith 2012-09-14 18:27:01 +00:00
parent 21f06f0fcb
commit da83703ed4
2 changed files with 5 additions and 4 deletions

View File

@ -2277,6 +2277,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename,
Tok.getAnnotationEndLoc(), Tok.getAnnotationEndLoc(),
PrevSpec, DiagID, T); PrevSpec, DiagID, T);
if (isInvalid)
break;
} }
else else
DS.SetTypeSpecError(); DS.SetTypeSpecError();
@ -2482,12 +2484,12 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
case tok::kw___forceinline: { case tok::kw___forceinline: {
isInvalid = DS.SetFunctionSpecInline(Loc, PrevSpec, DiagID); isInvalid = DS.SetFunctionSpecInline(Loc, PrevSpec, DiagID);
IdentifierInfo *AttrName = Tok.getIdentifierInfo(); IdentifierInfo *AttrName = Tok.getIdentifierInfo();
SourceLocation AttrNameLoc = ConsumeToken(); SourceLocation AttrNameLoc = Tok.getLocation();
// FIXME: This does not work correctly if it is set to be a declspec // FIXME: This does not work correctly if it is set to be a declspec
// attribute, and a GNU attribute is simply incorrect. // attribute, and a GNU attribute is simply incorrect.
DS.getAttributes().addNew(AttrName, AttrNameLoc, 0, AttrNameLoc, 0, DS.getAttributes().addNew(AttrName, AttrNameLoc, 0, AttrNameLoc, 0,
SourceLocation(), 0, 0, AttributeList::AS_GNU); SourceLocation(), 0, 0, AttributeList::AS_GNU);
continue; break;
} }
case tok::kw___ptr64: case tok::kw___ptr64:

View File

@ -948,7 +948,6 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
// Check that type of property and its ivar are type compatible. // Check that type of property and its ivar are type compatible.
if (!Context.hasSameType(PropertyIvarType, IvarType)) { if (!Context.hasSameType(PropertyIvarType, IvarType)) {
compat = false;
if (isa<ObjCObjectPointerType>(PropertyIvarType) if (isa<ObjCObjectPointerType>(PropertyIvarType)
&& isa<ObjCObjectPointerType>(IvarType)) && isa<ObjCObjectPointerType>(IvarType))
compat = compat =