]> granicus.if.org Git - clang/commitdiff
Fix some unused variable, control reaches end of non-void function,
authorDaniel Dunbar <daniel@zuster.org>
Thu, 15 Jan 2009 18:32:35 +0000 (18:32 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 15 Jan 2009 18:32:35 +0000 (18:32 +0000)
and uninitialized use options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62270 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp
lib/Analysis/SymbolManager.cpp
lib/CodeGen/CGObjC.cpp
lib/Sema/SemaLookup.cpp

index de6a14b87b6ed533d5b567cfc0f4a4814ba1ca82..6d98952545c4df3cf7e75359ead7ba06a6580204 100644 (file)
@@ -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");
 
index 746d55c23cf68b49c9ef665436853bd446c24343..f8f855594929e5b6be9cde91772a6efc17c92404 100644 (file)
@@ -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<VarRegion>(R)->getDecl());
   
@@ -38,8 +40,6 @@ SymbolRef SymbolManager::getSymbol(const MemRegion* R) {
     const FieldRegion* FR = cast<FieldRegion>(R);
     return getFieldSymbol(FR->getSuperRegion(), FR->getDecl());
   }
-  default:
-    assert(0 && "unprocessed region");
   }
 }
 
index a285d7533a99bdbd553b3e8e26c9a291ae522701..29740fdf8f8e8fdf5f5d388788e439e5eeb13bfe 100644 (file)
@@ -301,15 +301,14 @@ RValue CodeGenFunction::EmitObjCPropertyGet(const Expr *Exp) {
                                  EmitScalarExpr(E->getBase()), 
                                  false, CallArgList());
   }
-  else if (const ObjCKVCRefExpr *E = dyn_cast<ObjCKVCRefExpr>(Exp)) {
+  else {
+    const ObjCKVCRefExpr *E = cast<ObjCKVCRefExpr>(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,
index cc9a36ced223c1da40f71ffd3c5f22bef45b6220..6ef93ced24fa163eb52cbcae243e147abf9ab794 100644 (file)
@@ -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();