From 62bbe07f5aed5a2f9ae55ef480c4268cb4435d99 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 15 Mar 2013 21:41:35 +0000 Subject: [PATCH] Add some assertions to appease the static analyzer. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177185 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Rewrite/Frontend/RewriteModernObjC.cpp | 3 +-- lib/Sema/SemaExpr.cpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/lib/Rewrite/Frontend/RewriteModernObjC.cpp index caba62b118..03fd17f3da 100644 --- a/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -939,9 +939,8 @@ void RewriteModernObjC::RewritePropertyImplDecl(ObjCPropertyImplDecl *PID, // Generate the 'getter' function. ObjCPropertyDecl *PD = PID->getPropertyDecl(); ObjCIvarDecl *OID = PID->getPropertyIvarDecl(); + assert(IMD && OID && "Synthesized ivars must be attached to @implementation"); - if (!OID) - return; unsigned Attributes = PD->getPropertyAttributes(); if (mustSynthesizeSetterGetterMethod(IMD, PD, true /*getter*/)) { bool GenGetProperty = !(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) && diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index dc6132ca9f..3af64bb9f1 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3807,6 +3807,7 @@ bool Sema::GatherArgumentsForCall(SourceLocation CallLoc, Arg = ArgE.takeAs(); } else { + assert(FDecl && "can't use default arguments without a known callee"); Param = FDecl->getParamDecl(i); ExprResult ArgExpr = -- 2.40.0