From aa9a95ca4f1f1c512a9966e71eeb176c0f8d7a4c Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 31 Oct 2007 22:57:04 +0000 Subject: [PATCH] Changed direction of assert. Added more comments. llvm-svn: 43585 --- clang/Driver/RewriteTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index 55fb4d7565df..4e01dedcb55a 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/Driver/RewriteTest.cpp @@ -271,7 +271,7 @@ void RewriteTest::RewriteForwardClassDecl(ObjcClassDecl *ClassDecl) { // Mark this typedef as having been generated. if (!ObjcForwardDecls.insert(ForwardDecl)) - assert(true && "typedef already output"); + assert(false && "typedef already output"); } // Replace the @class with typedefs corresponding to the classes. @@ -551,6 +551,9 @@ void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl, } int NumIvars = CDecl->getIntfDeclNumIvars(); + // If no ivars and no root or if its root, directly or indirectly, + // have no ivars (thus not synthesize) + // then no need to synthesize this class either. if (NumIvars <= 0 && (!RCDecl || !ObjcSynthesizedStructs.count(RCDecl))) return; @@ -602,7 +605,7 @@ void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl, Result += "};\n"; // Mark this struct as having been generated. if (!ObjcSynthesizedStructs.insert(CDecl)) - assert(true && "struct already synthesize- SynthesizeObjcInternalStruct"); + assert(false && "struct already synthesize- SynthesizeObjcInternalStruct"); } // RewriteObjcMethodsMetaData - Rewrite methods metadata for instance or