]> granicus.if.org Git - clang/commitdiff
Fix else style. No functionality change intended.
authorChad Rosier <mcrosier@apple.com>
Wed, 17 Aug 2011 23:08:45 +0000 (23:08 +0000)
committerChad Rosier <mcrosier@apple.com>
Wed, 17 Aug 2011 23:08:45 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137896 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
lib/AST/Decl.cpp
lib/AST/DeclObjC.cpp
lib/Analysis/CFG.cpp
lib/Analysis/CocoaConventions.cpp
lib/Analysis/PrintfFormatString.cpp
lib/Analysis/UninitializedValues.cpp
lib/Driver/ArgList.cpp
lib/Driver/Driver.cpp
lib/Driver/Tools.cpp

index 1740eed4e06e082c3eaf205ee53e56fb8a59382f..a731782a7ac6d0f2d0e2eb285fd61c4e931b5a22 100644 (file)
@@ -1116,8 +1116,7 @@ void ASTContext::DeepCollectObjCIvars(const ObjCInterfaceDecl *OI,
     for (ObjCInterfaceDecl::ivar_iterator I = OI->ivar_begin(),
          E = OI->ivar_end(); I != E; ++I)
       Ivars.push_back(*I);
-  }
-  else {
+  } else {
     ObjCInterfaceDecl *IDecl = const_cast<ObjCInterfaceDecl *>(OI);
     for (const ObjCIvarDecl *Iv = IDecl->all_declared_ivar_begin(); Iv; 
          Iv= Iv->getNextIvar())
@@ -2762,8 +2761,7 @@ QualType ASTContext::getTypeOfExprType(Expr *tofExpr) const {
       // typeof(expr) type. Use that as our canonical type.
       toe = new (*this, TypeAlignment) TypeOfExprType(tofExpr,
                                           QualType((TypeOfExprType*)Canon, 0));
-    }
-    else {
+    } else {
       // Build a new, canonical typeof(expr) type.
       Canon
         = new (*this, TypeAlignment) DependentTypeOfExprType(*this, tofExpr);
@@ -2846,8 +2844,7 @@ QualType ASTContext::getDecltypeType(Expr *e) const {
       // decltype type. Use that as our canonical type.
       dt = new (*this, TypeAlignment) DecltypeType(e, DependentTy,
                                        QualType((DecltypeType*)Canon, 0));
-    }
-    else {
+    } else {
       // Build a new, canonical typeof(expr) type.
       Canon = new (*this, TypeAlignment) DependentDecltypeType(*this, e);
       DependentDecltypeTypes.InsertNode(Canon, InsertPos);
@@ -5246,8 +5243,7 @@ void getIntersectionOfProtocols(ASTContext &Context,
     for (unsigned i = 0; i < RHSNumProtocols; ++i)
       if (InheritedProtocolSet.count(RHSProtocols[i]))
         IntersectionOfProtocols.push_back(RHSProtocols[i]);
-  }
-  else {
+  } else {
     llvm::SmallPtrSet<ObjCProtocolDecl *, 8> RHSInheritedProtocols;
     Context.CollectInheritedProtocols(RHS->getInterface(),
                                       RHSInheritedProtocols);
index db7b570e05a7a2146a8e032f7b1ef74f822230f9..b76d67bd81bed9f1e15f843c06bf3e1ce42b3777 100644 (file)
@@ -1003,8 +1003,7 @@ void DeclaratorDecl::setQualifierInfo(NestedNameSpecifierLoc QualifierLoc) {
     }
     // Set qualifier info.
     getExtInfo()->QualifierLoc = QualifierLoc;
-  }
-  else {
+  } else {
     // Here Qualifier == 0, i.e., we are removing the qualifier (if any).
     if (hasExtInfo()) {
       if (getExtInfo()->NumTemplParamLists == 0) {
@@ -2290,8 +2289,7 @@ void TagDecl::setQualifierInfo(NestedNameSpecifierLoc QualifierLoc) {
       TypedefNameDeclOrQualifier = new (getASTContext()) ExtInfo;
     // Set qualifier info.
     getExtInfo()->QualifierLoc = QualifierLoc;
-  }
-  else {
+  } else {
     // Here Qualifier == 0, i.e., we are removing the qualifier (if any).
     if (hasExtInfo()) {
       if (getExtInfo()->NumTemplParamLists == 0) {
index fd034d0efffe8e629115ec802decf2ee19d4f3d0..813501f1ac99d40b003bf9a4e9c6f92396c10dea 100644 (file)
@@ -758,8 +758,7 @@ ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, ObjCContainerDecl *DC,
         ID = IM->getClassInterface();
         if (BW)
           IM->setHasSynthBitfield(true);
-      }
-      else {
+      } else {
         ObjCCategoryDecl *CD = cast<ObjCCategoryDecl>(DC);
         ID = CD->getClassInterface();
         if (BW)
index a1997ab6a9320eb8e2b1063b6a7a406ac225f155..65dabda7e76f38fb67a3bf1bab7ccd4c294723e8 100644 (file)
@@ -2203,8 +2203,7 @@ CFGBlock *CFGBuilder::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E,
     for (const VariableArrayType *VA =FindVA(E->getArgumentType().getTypePtr());
          VA != 0; VA = FindVA(VA->getElementType().getTypePtr()))
       lastBlock = addStmt(VA->getSizeExpr());
-  }
-  else {
+  } else {
     // For sizeof(x), where 'x' is a VLA, we should include the computation
     // of the lvalue of 'x'.
     Expr *subEx = E->getArgumentExpr();
index 176701a3ef4e4c48b61f3ba4d6dc42b4482465fc..ea60f26e22a249cc104f5364ac657dcbaa5001b4 100644 (file)
@@ -152,8 +152,7 @@ bool coreFoundation::followsCreateRule(StringRef functionName) {
     }
     else if (suffix.startswith("opy")) {
       it += 3;
-    }
-    else {
+    } else {
       // Keep scanning.
       continue;
     }
index 8b23a071d98079e4f9d7273c391f49d70c6b3cf3..eb018f1eb5fac817ea2f016a0de922e29dd365cf 100644 (file)
@@ -38,8 +38,7 @@ static bool ParsePrecision(FormatStringHandler &H, PrintfSpecifier &FS,
                            unsigned *argIndex) {
   if (argIndex) {
     FS.setPrecision(ParseNonPositionAmount(Beg, E, *argIndex));
-  }
-  else {
+  } else {
     const OptionalAmount Amt = ParsePositionAmount(H, Start, Beg, E,
                                            analyze_format_string::PrecisionPos);
     if (Amt.isInvalid())
@@ -461,8 +460,7 @@ bool PrintfSpecifier::fixType(QualType QT) {
       CS.setKind(ConversionSpecifier::uArg);
     HasAlternativeForm = 0;
     HasPlusPrefix = 0;
-  }
-  else {
+  } else {
     assert(0 && "Unexpected type");
   }
 
index 751258362a30f92fbc6eeee0179ac96c6be2bf58..84530227dff87cdbb87dd68aa497b48c38548f18 100644 (file)
@@ -425,8 +425,7 @@ void TransferFunctions::VisitObjCForCollectionStmt(ObjCForCollectionStmt *fs) {
     vd = cast<VarDecl>(ds->getSingleDecl());
     if (!isTrackedVar(vd))
       vd = 0;
-  }
-  else {
+  } else {
     // Initialize the value of the reference variable.
     const FindVarResult &res = findBlockVarDecl(cast<Expr>(element));
     vd = res.getDecl();
@@ -642,8 +641,7 @@ static bool runOnBlock(const CFGBlock *block, const CFG &cfg,
       vals.mergeIntoScratch(*(vB.second ? vB.second : vB.first), false);
       valsAB.first = vA.first;
       valsAB.second = &vals.getScratch();
-    }
-    else {
+    } else {
       // Merge the 'T' bits from the first and second.
       assert(b->getOpcode() == BO_LOr);
       vals.mergeIntoScratch(*vA.first, true);
index c76356ca20ba38c1c12d26618522c19bc9935e07..6f7cbb6062d1fc09613d7796d29b7d9ef003cd69 100644 (file)
@@ -51,8 +51,9 @@ void ArgList::eraseArg(OptSpecifier Id) {
     if ((*it)->getOption().matches(Id)) {
       it = Args.erase(it);
       ie = end();
-    } else
+    } else {
       ++it;
+    }
   }
 }
 
index ec6a07a54b5f3bd49ba410933dead6741f0c1d53..84321139ff2544e9b4a55d16d9804be52af2df66 100644 (file)
@@ -397,8 +397,9 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
     if (types::getPreprocessedType(it->first) == types::TY_INVALID) {
       it = Inputs.erase(it);
       ie = Inputs.end();
-    } else
+    } else {
       ++it;
+    }
   }
   if (Inputs.empty()) {
     Diag(clang::diag::note_drv_command_failed_diag_msg)
index f006c3b391cc5a9601c565e7a8504f58dc83d194..f6600ed1e445474f7eb73443be2c85d7059564a2 100644 (file)
@@ -2438,11 +2438,10 @@ darwin::CC1::getDependencyFileName(const ArgList &Args,
 
   if (Arg *OutputOpt = Args.getLastArg(options::OPT_o)) {
     std::string Str(OutputOpt->getValue(Args));
-
     Res = Str.substr(0, Str.rfind('.'));
-  } else
+  } else {
     Res = darwin::CC1::getBaseInputStem(Args, Inputs);
-
+  }
   return Args.MakeArgString(Res + ".d");
 }
 
@@ -2452,9 +2451,9 @@ void darwin::CC1::RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const {
     if (!strcmp(*it, "-Wno-self-assign")) {
       it = CmdArgs.erase(it);
       ie = CmdArgs.end();
-    }
-    else
+    } else {
       ++it;
+    }
   }
 }