r177185 - Add some assertions to appease the static analyzer.
Jordan Rose
jordan_rose at apple.com
Fri Mar 15 14:41:35 PDT 2013
Author: jrose
Date: Fri Mar 15 16:41:35 2013
New Revision: 177185
URL: http://llvm.org/viewvc/llvm-project?rev=177185&view=rev
Log:
Add some assertions to appease the static analyzer.
No functionality change.
Modified:
cfe/trunk/lib/Rewrite/Frontend/RewriteModernObjC.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Rewrite/Frontend/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Frontend/RewriteModernObjC.cpp?rev=177185&r1=177184&r2=177185&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Frontend/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/Frontend/RewriteModernObjC.cpp Fri Mar 15 16:41:35 2013
@@ -939,9 +939,8 @@ void RewriteModernObjC::RewritePropertyI
// 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) &&
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=177185&r1=177184&r2=177185&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Mar 15 16:41:35 2013
@@ -3807,6 +3807,7 @@ bool Sema::GatherArgumentsForCall(Source
Arg = ArgE.takeAs<Expr>();
} else {
+ assert(FDecl && "can't use default arguments without a known callee");
Param = FDecl->getParamDecl(i);
ExprResult ArgExpr =
More information about the cfe-commits
mailing list