diff options
author | David Blaikie <dblaikie@gmail.com> | 2011-09-23 05:06:16 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2011-09-23 05:06:16 +0000 |
commit | b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 (patch) | |
tree | 2b708dc00bedcc6a6204d29c915ac7fce8fb028f /lib/Rewrite/RewriteObjC.cpp | |
parent | c535d9730e11ca335790359bfbd4600be71c5410 (diff) |
Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index fa287fd534..4f9c1748ce 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -1066,7 +1066,7 @@ void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) { void RewriteObjC::RewriteForwardProtocolDecl(ObjCForwardProtocolDecl *PDecl) { SourceLocation LocStart = PDecl->getLocation(); if (LocStart.isInvalid()) - assert(false && "Invalid SourceLocation"); + llvm_unreachable("Invalid SourceLocation"); // FIXME: handle forward protocol that are declared across multiple lines. ReplaceText(LocStart, 0, "// "); } @@ -2063,7 +2063,7 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) { // declares the @catch parameter). ReplaceText(rParenLoc, bodyBuf-rParenBuf+1, " = _caught;"); } else { - assert(false && "@catch rewrite bug"); + llvm_unreachable("@catch rewrite bug"); } } // Complete the catch list... @@ -3434,7 +3434,7 @@ void RewriteObjC::SynthesizeObjCInternalStruct(ObjCInterfaceDecl *CDecl, } // Mark this struct as having been generated. if (!ObjCSynthesizedStructs.insert(CDecl)) - assert(false && "struct already synthesize- SynthesizeObjCInternalStruct"); + llvm_unreachable("struct already synthesize- SynthesizeObjCInternalStruct"); } // RewriteObjCMethodsMetaData - Rewrite methods metadata for instance or @@ -3655,7 +3655,7 @@ RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl, StringRef prefix, // Mark this protocol as having been generated. if (!ObjCSynthesizedProtocols.insert(PDecl)) - assert(false && "protocol already synthesized"); + llvm_unreachable("protocol already synthesized"); } @@ -5048,7 +5048,7 @@ void RewriteObjC::RewriteBlockPointerDecl(NamedDecl *ND) { else if (FieldDecl *FD = dyn_cast<FieldDecl>(ND)) DeclT = FD->getType(); else - assert(0 && "RewriteBlockPointerDecl(): Decl type not yet handled"); + llvm_unreachable("RewriteBlockPointerDecl(): Decl type not yet handled"); const char *startBuf = SM->getCharacterData(DeclLoc); const char *endBuf = startBuf; @@ -5966,7 +5966,7 @@ void RewriteObjC::HandleDeclInMainFile(Decl *D) { else if (ObjCCategoryImplDecl *CI = dyn_cast<ObjCCategoryImplDecl>(D)) CategoryImplementation.push_back(CI); else if (isa<ObjCClassDecl>(D)) - assert(false && "RewriteObjC::HandleDeclInMainFile - ObjCClassDecl"); + llvm_unreachable("RewriteObjC::HandleDeclInMainFile - ObjCClassDecl"); else if (VarDecl *VD = dyn_cast<VarDecl>(D)) { RewriteObjCQualifiedInterfaceTypes(VD); if (isTopLevelBlockPointerType(VD->getType())) |