From: Daniel Dunbar Date: Thu, 15 Jan 2009 18:32:35 +0000 (+0000) Subject: Fix some unused variable, control reaches end of non-void function, X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f185319f25efd6094870f287030270fad26085ba;p=clang Fix some unused variable, control reaches end of non-void function, and uninitialized use options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62270 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index de6a14b87b..6d98952545 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -1219,6 +1219,7 @@ bool Expr::isEvaluatable(ASTContext &Ctx) const { APSInt Expr::EvaluateAsInt(ASTContext &Ctx) const { EvalResult EvalResult; bool Result = Evaluate(EvalResult, Ctx); + Result = Result; assert(Result && "Could not evaluate expression"); assert(EvalResult.Val.isInt() && "Expression did not evaluate to integer"); diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp index 746d55c23c..f8f8555949 100644 --- a/lib/Analysis/SymbolManager.cpp +++ b/lib/Analysis/SymbolManager.cpp @@ -24,6 +24,8 @@ void SymbolRef::print(llvm::raw_ostream& os) const { SymbolRef SymbolManager::getSymbol(const MemRegion* R) { switch (R->getKind()) { + default: + assert(0 && "unprocessed region"); case MemRegion::VarRegionKind: return getSymbol(cast(R)->getDecl()); @@ -38,8 +40,6 @@ SymbolRef SymbolManager::getSymbol(const MemRegion* R) { const FieldRegion* FR = cast(R); return getFieldSymbol(FR->getSuperRegion(), FR->getDecl()); } - default: - assert(0 && "unprocessed region"); } } diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index a285d7533a..29740fdf8f 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -301,15 +301,14 @@ RValue CodeGenFunction::EmitObjCPropertyGet(const Expr *Exp) { EmitScalarExpr(E->getBase()), false, CallArgList()); } - else if (const ObjCKVCRefExpr *E = dyn_cast(Exp)) { + else { + const ObjCKVCRefExpr *E = cast(Exp); Selector S = E->getGetterMethod()->getSelector(); return CGM.getObjCRuntime(). GenerateMessageSend(*this, Exp->getType(), S, EmitScalarExpr(E->getBase()), false, CallArgList()); } - else - assert (0 && "bad expression node in EmitObjCPropertyGet"); } void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp, diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index cc9a36ced2..6ef93ced24 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -490,7 +490,7 @@ Sema::LookupQualifiedName(DeclContext *LookupCtx, DeclarationName Name, // the result of the lookup. // FIXME: support using declarations! QualType SubobjectType; - int SubobjectNumber; + int SubobjectNumber = 0; for (BasePaths::paths_iterator Path = Paths.begin(), PathEnd = Paths.end(); Path != PathEnd; ++Path) { const BasePathElement &PathElement = Path->back();