]> granicus.if.org Git - clang/commitdiff
Fix some use of uninit variables issues, reported by Anton.
authorChris Lattner <sabre@nondot.org>
Thu, 27 Sep 2007 15:15:46 +0000 (15:15 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 27 Sep 2007 15:15:46 +0000 (15:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42396 91177308-0d34-0410-b5e6-96231b3b80d8

AST/CFG.cpp
Parse/ParseObjc.cpp
Sema/SemaDecl.cpp

index d91f9c3c57ff3279fb23a3969a457dab93448a4b..e1c1a7474c3daa2326f84677f26e75eeb168511d 100644 (file)
@@ -393,7 +393,7 @@ CFGBlock* CFGBuilder::VisitNullStmt(NullStmt* Statement) {
 CFGBlock* CFGBuilder::VisitCompoundStmt(CompoundStmt* C) {
   //   The value returned from this function is the last created CFGBlock
   //   that represents the "entry" point for the translated AST node.
-  CFGBlock* LastBlock;
+  CFGBlock* LastBlock = 0;
   
   for (CompoundStmt::reverse_body_iterator I = C->body_rbegin(),
        E = C->body_rend(); I != E; ++I )
index 16434cdcddbfc909d3dcc025377239f2134e08b8..9da15fafd270a773ca2fbb95b7b6ec0c28c03688 100644 (file)
@@ -445,7 +445,7 @@ Parser::TypeTy *Parser::ParseObjCTypeName() {
   assert(Tok.getKind() == tok::l_paren && "expected (");
   
   SourceLocation LParenLoc = ConsumeParen(), RParenLoc;
-  TypeTy *Ty;
+  TypeTy *Ty = 0;
   
   while (isObjCTypeQualifier())
     ConsumeToken();
index ae9c719471b451786c2730d5a7001decf88a7351..dd8fe22cc9420800b8155b86b895ac7bfa30f38a 100644 (file)
@@ -485,7 +485,7 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) {
     QualType R = GetTypeForDeclarator(D, S);
     assert(!R.isNull() && "GetTypeForDeclarator() returned null type");
 
-    FunctionDecl::StorageClass SC;
+    FunctionDecl::StorageClass SC = FunctionDecl::None;
     switch (D.getDeclSpec().getStorageClassSpec()) {
       default: assert(0 && "Unknown storage class!");
       case DeclSpec::SCS_auto: