From 33d34a6f7a65be1821ab31c7d08b8e9f36d8759c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 12 Oct 2008 00:28:42 +0000 Subject: [PATCH] silence some release-assert warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57391 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/DeclSerialization.cpp | 1 - lib/Lex/Lexer.cpp | 3 +-- lib/Sema/SemaDecl.cpp | 14 +++++++------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/AST/DeclSerialization.cpp b/lib/AST/DeclSerialization.cpp index 2ebcb76fbf..718885b2b5 100644 --- a/lib/AST/DeclSerialization.cpp +++ b/lib/AST/DeclSerialization.cpp @@ -42,7 +42,6 @@ Decl* Decl::Create(Deserializer& D, ASTContext& C) { switch (k) { default: assert (false && "Not implemented."); - break; case TranslationUnit: Dcl = TranslationUnitDecl::CreateImpl(D, C); diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 8acfe2aef6..c99dc1d4b8 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -105,8 +105,7 @@ Lexer::Lexer(SourceLocation fileloc, Preprocessor &pp, /// Lexer constructor - Create a new raw lexer object. This object is only /// suitable for calls to 'LexRawToken'. This lexer assumes that the -/// associated file buffer will outlive it, so it doesn't take ownership of -/// either of them. +/// associated file buffer will outlive it, so it doesn't take ownership of it. Lexer::Lexer(SourceLocation fileloc, const LangOptions &features, const char *BufStart, const char *BufEnd) : FileLoc(fileloc), PP(0), Features(features) { diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 1b6ff878f5..6ee4ae17ec 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2067,11 +2067,11 @@ Sema::DeclTy *Sema::ActOnField(Scope *S, static ObjCIvarDecl::AccessControl TranslateIvarVisibility(tok::ObjCKeywordKind ivarVisibility) { switch (ivarVisibility) { - case tok::objc_private: return ObjCIvarDecl::Private; - case tok::objc_public: return ObjCIvarDecl::Public; - case tok::objc_protected: return ObjCIvarDecl::Protected; - case tok::objc_package: return ObjCIvarDecl::Package; - default: assert(false && "Unknown visitibility kind"); + default: assert(0 && "Unknown visitibility kind"); + case tok::objc_private: return ObjCIvarDecl::Private; + case tok::objc_public: return ObjCIvarDecl::Public; + case tok::objc_protected: return ObjCIvarDecl::Protected; + case tok::objc_package: return ObjCIvarDecl::Package; } } @@ -2249,8 +2249,8 @@ void Sema::ActOnFields(Scope* S, Diag(FD->getLocation(), diag::err_duplicate_member, II->getName()); // Find the previous decl. SourceLocation PrevLoc; - for (unsigned i = 0, e = RecFields.size(); ; ++i) { - assert(i != e && "Didn't find previous def!"); + for (unsigned i = 0; ; ++i) { + assert(i != RecFields.size() && "Didn't find previous def!"); if (RecFields[i]->getIdentifier() == II) { PrevLoc = RecFields[i]->getLocation(); break; -- 2.40.0