Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index 7a0d6d6..a6f2b82 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -33,12 +33,12 @@
     PrintingPolicy Policy;
 
   public:
-    StmtPrinter(llvm::raw_ostream &os, ASTContext &C, PrinterHelper* helper, 
+    StmtPrinter(llvm::raw_ostream &os, ASTContext &C, PrinterHelper* helper,
                 const PrintingPolicy &Policy,
                 unsigned Indentation = 0)
       : OS(os), Context(C), IndentLevel(Indentation), Helper(helper),
         Policy(Policy) {}
-    
+
     void PrintStmt(Stmt *S) {
       PrintStmt(S, Policy.Indentation);
     }
@@ -63,29 +63,29 @@
     void PrintRawDeclStmt(DeclStmt *S);
     void PrintRawIfStmt(IfStmt *If);
     void PrintRawCXXCatchStmt(CXXCatchStmt *Catch);
-    
+
     void PrintExpr(Expr *E) {
       if (E)
         Visit(E);
       else
         OS << "<null expr>";
     }
-    
+
     llvm::raw_ostream &Indent(int Delta = 0) {
       for (int i = 0, e = IndentLevel+Delta; i < e; ++i)
         OS << "  ";
       return OS;
     }
-    
+
     bool PrintOffsetOfDesignator(Expr *E);
     void VisitUnaryOffsetOf(UnaryOperator *Node);
-    
-    void Visit(Stmt* S) {    
+
+    void Visit(Stmt* S) {
       if (Helper && Helper->handledStmt(S,OS))
           return;
       else StmtVisitor<StmtPrinter>::Visit(S);
     }
-    
+
     void VisitStmt(Stmt *Node);
 #define STMT(CLASS, PARENT) \
     void Visit##CLASS(CLASS *Node);
@@ -108,7 +108,7 @@
   for (CompoundStmt::body_iterator I = Node->body_begin(), E = Node->body_end();
        I != E; ++I)
     PrintStmt(*I);
-  
+
   Indent() << "}";
 }
 
@@ -119,7 +119,7 @@
 void StmtPrinter::PrintRawDeclStmt(DeclStmt *S) {
   DeclStmt::decl_iterator Begin = S->decl_begin(), End = S->decl_end();
   llvm::SmallVector<Decl*, 2> Decls;
-  for ( ; Begin != End; ++Begin) 
+  for ( ; Begin != End; ++Begin)
     Decls.push_back(*Begin);
 
   Decl::printGroup(Decls.data(), Decls.size(), OS, Policy, IndentLevel);
@@ -149,7 +149,7 @@
     PrintExpr(Node->getRHS());
   }
   OS << ":\n";
-  
+
   PrintStmt(Node->getSubStmt(), 0);
 }
 
@@ -167,7 +167,7 @@
   OS << "if (";
   PrintExpr(If->getCond());
   OS << ')';
-  
+
   if (CompoundStmt *CS = dyn_cast<CompoundStmt>(If->getThen())) {
     OS << ' ';
     PrintRawCompoundStmt(CS);
@@ -177,10 +177,10 @@
     PrintStmt(If->getThen());
     if (If->getElse()) Indent();
   }
-  
+
   if (Stmt *Else = If->getElse()) {
     OS << "else";
-    
+
     if (CompoundStmt *CS = dyn_cast<CompoundStmt>(Else)) {
       OS << ' ';
       PrintRawCompoundStmt(CS);
@@ -204,7 +204,7 @@
   Indent() << "switch (";
   PrintExpr(Node->getCond());
   OS << ")";
-  
+
   // Pretty print compoundstmt bodies (very common).
   if (CompoundStmt *CS = dyn_cast<CompoundStmt>(Node->getBody())) {
     OS << " ";
@@ -237,7 +237,7 @@
     PrintStmt(Node->getBody());
     Indent();
   }
-  
+
   OS << "while (";
   PrintExpr(Node->getCond());
   OS << ");\n";
@@ -262,7 +262,7 @@
     PrintExpr(Node->getInc());
   }
   OS << ") ";
-  
+
   if (CompoundStmt *CS = dyn_cast<CompoundStmt>(Node->getBody())) {
     PrintRawCompoundStmt(CS);
     OS << "\n";
@@ -281,7 +281,7 @@
   OS << " in ";
   PrintExpr(Node->getCollection());
   OS << ") ";
-  
+
   if (CompoundStmt *CS = dyn_cast<CompoundStmt>(Node->getBody())) {
     PrintRawCompoundStmt(CS);
     OS << "\n";
@@ -322,63 +322,63 @@
 
 void StmtPrinter::VisitAsmStmt(AsmStmt *Node) {
   Indent() << "asm ";
-  
+
   if (Node->isVolatile())
     OS << "volatile ";
-  
+
   OS << "(";
   VisitStringLiteral(Node->getAsmString());
-  
+
   // Outputs
   if (Node->getNumOutputs() != 0 || Node->getNumInputs() != 0 ||
       Node->getNumClobbers() != 0)
     OS << " : ";
-  
+
   for (unsigned i = 0, e = Node->getNumOutputs(); i != e; ++i) {
     if (i != 0)
       OS << ", ";
-    
+
     if (!Node->getOutputName(i).empty()) {
       OS << '[';
       OS << Node->getOutputName(i);
       OS << "] ";
     }
-    
+
     VisitStringLiteral(Node->getOutputConstraintLiteral(i));
     OS << " ";
     Visit(Node->getOutputExpr(i));
   }
-  
+
   // Inputs
   if (Node->getNumInputs() != 0 || Node->getNumClobbers() != 0)
     OS << " : ";
-  
+
   for (unsigned i = 0, e = Node->getNumInputs(); i != e; ++i) {
     if (i != 0)
       OS << ", ";
-    
+
     if (!Node->getInputName(i).empty()) {
       OS << '[';
       OS << Node->getInputName(i);
       OS << "] ";
     }
-    
+
     VisitStringLiteral(Node->getInputConstraintLiteral(i));
     OS << " ";
     Visit(Node->getInputExpr(i));
   }
-  
+
   // Clobbers
   if (Node->getNumClobbers() != 0)
     OS << " : ";
-    
+
   for (unsigned i = 0, e = Node->getNumClobbers(); i != e; ++i) {
     if (i != 0)
       OS << ", ";
-      
+
     VisitStringLiteral(Node->getClobber(i));
   }
-  
+
   OS << ");\n";
 }
 
@@ -388,11 +388,11 @@
     PrintRawCompoundStmt(TS);
     OS << "\n";
   }
-  
-  for (ObjCAtCatchStmt *catchStmt = 
+
+  for (ObjCAtCatchStmt *catchStmt =
          static_cast<ObjCAtCatchStmt *>(Node->getCatchStmts());
-       catchStmt; 
-       catchStmt = 
+       catchStmt;
+       catchStmt =
          static_cast<ObjCAtCatchStmt *>(catchStmt->getNextCatchStmt())) {
     Indent() << "@catch(";
     if (catchStmt->getCatchParamDecl()) {
@@ -400,19 +400,18 @@
         PrintRawDecl(DS);
     }
     OS << ")";
-    if (CompoundStmt *CS = dyn_cast<CompoundStmt>(catchStmt->getCatchBody())) 
-      {
-        PrintRawCompoundStmt(CS);
-        OS << "\n";
-      } 
+    if (CompoundStmt *CS = dyn_cast<CompoundStmt>(catchStmt->getCatchBody())) {
+      PrintRawCompoundStmt(CS);
+      OS << "\n";
+    }
   }
-  
-  if (ObjCAtFinallyStmt *FS =static_cast<ObjCAtFinallyStmt *>(
-          Node->getFinallyStmt())) {
+
+  if (ObjCAtFinallyStmt *FS = static_cast<ObjCAtFinallyStmt *>(
+        Node->getFinallyStmt())) {
     Indent() << "@finally";
     PrintRawCompoundStmt(dyn_cast<CompoundStmt>(FS->getFinallyBody()));
     OS << "\n";
-  }  
+  }
 }
 
 void StmtPrinter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *Node) {
@@ -458,7 +457,7 @@
 void StmtPrinter::VisitCXXTryStmt(CXXTryStmt *Node) {
   Indent() << "try ";
   PrintRawCompoundStmt(Node->getTryBlock());
-  for(unsigned i = 0, e = Node->getNumHandlers(); i < e; ++i) {
+  for (unsigned i = 0, e = Node->getNumHandlers(); i < e; ++i) {
     OS << " ";
     PrintRawCXXCatchStmt(Node->getHandler(i));
   }
@@ -477,14 +476,14 @@
   OS << Node->getDecl()->getNameAsString();
 }
 
-void StmtPrinter::VisitQualifiedDeclRefExpr(QualifiedDeclRefExpr *Node) {  
+void StmtPrinter::VisitQualifiedDeclRefExpr(QualifiedDeclRefExpr *Node) {
   NamedDecl *D = Node->getDecl();
 
   Node->getQualifier()->print(OS, Policy);
   OS << D->getNameAsString();
 }
 
-void StmtPrinter::VisitUnresolvedDeclRefExpr(UnresolvedDeclRefExpr *Node) {  
+void StmtPrinter::VisitUnresolvedDeclRefExpr(UnresolvedDeclRefExpr *Node) {
   Node->getQualifier()->print(OS, Policy);
   OS << Node->getDeclName().getAsString();
 }
@@ -523,7 +522,7 @@
   }
   if (Node->getGetterMethod())
     OS << Node->getGetterMethod()->getNameAsString();
-    
+
 }
 
 void StmtPrinter::VisitPredefinedExpr(PredefinedExpr *Node) {
@@ -594,7 +593,7 @@
 void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) {
   bool isSigned = Node->getType()->isSignedIntegerType();
   OS << Node->getValue().toString(10, isSigned);
-  
+
   // Emit suffixes.  Integer literals are always a builtin integer type.
   switch (Node->getType()->getAsBuiltinType()->getKind()) {
   default: assert(0 && "Unexpected type for integer literal!");
@@ -623,7 +622,7 @@
   // FIXME: this doesn't print wstrings right.
   for (unsigned i = 0, e = Str->getByteLength(); i != e; ++i) {
     unsigned char Char = Str->getStrData()[i];
-    
+
     switch (Char) {
     default:
       if (isprint(Char))
@@ -653,7 +652,7 @@
 void StmtPrinter::VisitUnaryOperator(UnaryOperator *Node) {
   if (!Node->isPostfix()) {
     OS << UnaryOperator::getOpcodeStr(Node->getOpcode());
-    
+
     // Print a space if this is an "identifier operator" like __real, or if
     // it might be concatenated incorrectly like '+'.
     switch (Node->getOpcode()) {
@@ -671,7 +670,7 @@
     }
   }
   PrintExpr(Node->getSubExpr());
-  
+
   if (Node->isPostfix())
     OS << UnaryOperator::getOpcodeStr(Node->getOpcode());
 }
@@ -741,7 +740,7 @@
     Qualifier->print(OS, Policy);
 
   OS << Node->getMemberDecl()->getNameAsString();
-  
+
   if (Node->hasExplicitTemplateArgumentList())
     OS << TemplateSpecializationType::PrintTemplateArgumentList(
                                                     Node->getTemplateArgs(),
@@ -788,7 +787,7 @@
 }
 void StmtPrinter::VisitConditionalOperator(ConditionalOperator *Node) {
   PrintExpr(Node->getCond());
-  
+
   if (Node->getLHS()) {
     OS << " ? ";
     PrintExpr(Node->getLHS());
@@ -797,7 +796,7 @@
   else { // Handle GCC extension where LHS can be NULL.
     OS << " ?: ";
   }
-  
+
   PrintExpr(Node->getRHS());
 }
 
@@ -884,7 +883,7 @@
       } else {
         PrintExpr(Node->getArrayRangeStart(*D));
         OS << " ... ";
-        PrintExpr(Node->getArrayRangeEnd(*D));        
+        PrintExpr(Node->getArrayRangeEnd(*D));
       }
       OS << "]";
     }
@@ -1036,7 +1035,7 @@
   OS << Node->getType().getAsString();
   OS << "(";
   for (CXXTemporaryObjectExpr::arg_iterator Arg = Node->arg_begin(),
-                                         ArgEnd = Node->arg_end(); 
+                                         ArgEnd = Node->arg_end();
        Arg != ArgEnd; ++Arg) {
     if (Arg != Node->arg_begin())
       OS << ", ";
@@ -1113,7 +1112,7 @@
     OS << '.';
   if (E->getQualifier())
     E->getQualifier()->print(OS, Policy);
-  
+
   std::string TypeS;
   E->getDestroyedType().getAsStringInternal(TypeS, Policy);
   OS << TypeS;
@@ -1132,13 +1131,13 @@
   PrintExpr(E->getSubExpr());
 }
 
-void 
+void
 StmtPrinter::VisitCXXUnresolvedConstructExpr(
                                            CXXUnresolvedConstructExpr *Node) {
   OS << Node->getTypeAsWritten().getAsString();
   OS << "(";
   for (CXXUnresolvedConstructExpr::arg_iterator Arg = Node->arg_begin(),
-                                             ArgEnd = Node->arg_end(); 
+                                             ArgEnd = Node->arg_end();
        Arg != ArgEnd; ++Arg) {
     if (Arg != Node->arg_begin())
       OS << ", ";
@@ -1155,9 +1154,9 @@
   else if (Node->hasExplicitTemplateArgumentList())
     // FIXME: Track use of "template" keyword explicitly?
     OS << "template ";
-  
+
   OS << Node->getMember().getAsString();
-  
+
   if (Node->hasExplicitTemplateArgumentList()) {
     OS << TemplateSpecializationType::PrintTemplateArgumentList(
                                                     Node->getTemplateArgs(),
@@ -1192,7 +1191,7 @@
      << E->getQueriedType().getAsString() << ")";
 }
 
-// Obj-C 
+// Obj-C
 
 void StmtPrinter::VisitObjCStringLiteral(ObjCStringLiteral *Node) {
   OS << "@";
@@ -1230,7 +1229,7 @@
            OS << ":";
       }
       else OS << ", "; // Handle variadic methods.
-      
+
       PrintExpr(Mess->getArg(i));
     }
   }
@@ -1244,9 +1243,9 @@
 void StmtPrinter::VisitBlockExpr(BlockExpr *Node) {
   BlockDecl *BD = Node->getBlockDecl();
   OS << "^";
-  
+
   const FunctionType *AFT = Node->getFunctionType();
-  
+
   if (isa<FunctionNoProtoType>(AFT)) {
     OS << "()";
   } else if (!BD->param_empty() || cast<FunctionProtoType>(AFT)->isVariadic()) {
@@ -1259,7 +1258,7 @@
       (*AI)->getType().getAsStringInternal(ParamStr, Policy);
       OS << ParamStr;
     }
-    
+
     const FunctionProtoType *FT = cast<FunctionProtoType>(AFT);
     if (FT->isVariadic()) {
       if (!BD->param_empty()) OS << ", ";
@@ -1294,7 +1293,7 @@
     dump(Context.getSourceManager());
     return;
   }
-  
+
   StmtPrinter P(OS, Context, Helper, Policy, Indentation);
   P.Visit(const_cast<Stmt*>(this));
 }