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/Index/ASTLocation.cpp b/lib/Index/ASTLocation.cpp
index f010a2b..d6f5cc7 100644
--- a/lib/Index/ASTLocation.cpp
+++ b/lib/Index/ASTLocation.cpp
@@ -32,7 +32,7 @@
     return getDeclFromExpr(CE->getCallee());
   if (CastExpr *CE = dyn_cast<CastExpr>(E))
     return getDeclFromExpr(CE->getSubExpr());
-  
+
   return 0;
 }
 
@@ -41,7 +41,7 @@
     return 0;
   if (isDecl())
     return getDecl();
-  
+
   assert(getStmt());
   return getDeclFromExpr(getStmt());
 }
@@ -49,17 +49,17 @@
 
 static bool isContainedInStatement(Stmt *Node, Stmt *Parent) {
   assert(Node && Parent && "Passed null Node or Parent");
-  
+
   if (Node == Parent)
     return true;
-  
+
   for (Stmt::child_iterator
          I = Parent->child_begin(), E = Parent->child_end(); I != E; ++I) {
     if (*I)
       if (isContainedInStatement(Node, *I))
         return true;
   }
-  
+
   return false;
 }
 
@@ -76,7 +76,7 @@
   if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
     if (!FD->isThisDeclarationADefinition())
       return 0;
-    
+
     for (DeclContext::decl_iterator
            I = FD->decls_begin(), E = FD->decls_end(); I != E; ++I) {
       Decl *Child = FindImmediateParent(*I, Node);
@@ -138,7 +138,7 @@
   OS << "[Decl: " << getDecl()->getDeclKindName() << " ";
   if (const NamedDecl *ND = dyn_cast<NamedDecl>(getDecl()))
     OS << ND->getNameAsString();
-  
+
   if (getStmt()) {
     ASTContext &Ctx = getDecl()->getASTContext();
     OS << " | Stmt: " << getStmt()->getStmtClassName() << " ";
@@ -146,7 +146,7 @@
   }
 
   OS << "] <";
-  
+
   SourceRange Range = getSourceRange();
   SourceManager &SourceMgr = getDecl()->getASTContext().getSourceManager();
   Range.getBegin().print(OS, SourceMgr);
diff --git a/lib/Index/Analyzer.cpp b/lib/Index/Analyzer.cpp
index 1dd2178..cda2c50 100644
--- a/lib/Index/Analyzer.cpp
+++ b/lib/Index/Analyzer.cpp
@@ -36,11 +36,11 @@
 class VISIBILITY_HIDDEN DeclEntityAnalyzer : public TranslationUnitHandler {
   Entity Ent;
   TULocationHandler &TULocHandler;
-  
+
 public:
   DeclEntityAnalyzer(Entity ent, TULocationHandler &handler)
     : Ent(ent), TULocHandler(handler) { }
-  
+
   virtual void Handle(TranslationUnit *TU) {
     assert(TU && "Passed null translation unit");
 
@@ -60,11 +60,11 @@
 class VISIBILITY_HIDDEN RefEntityAnalyzer : public TranslationUnitHandler {
   Entity Ent;
   TULocationHandler &TULocHandler;
-  
+
 public:
   RefEntityAnalyzer(Entity ent, TULocationHandler &handler)
     : Ent(ent), TULocHandler(handler) { }
-  
+
   virtual void Handle(TranslationUnit *TU) {
     assert(TU && "Passed null translation unit");
 
@@ -115,12 +115,12 @@
     IFaceEnt = Entity::get(IFD, Prog);
     GlobSel = GlobalSelector::get(MD->getSelector(), Prog);
     IsInstanceMethod = MD->isInstanceMethod();
-    
+
     for (ObjCInterfaceDecl *Cls = IFD->getSuperClass();
            Cls; Cls = Cls->getSuperClass())
       HierarchyEntities.insert(Entity::get(Cls, Prog));
   }
-  
+
   virtual void Handle(TranslationUnit *TU) {
     assert(TU && "Passed null translation unit");
 
@@ -150,7 +150,7 @@
     // FIXME: Finding @selector references should be through another Analyzer
     // method, like FindSelectors.
     if (isa<ObjCSelectorExpr>(ASTLoc.getStmt()))
-      return false;      
+      return false;
 
     ObjCInterfaceDecl *MsgD = 0;
     ObjCMessageExpr *Msg = cast<ObjCMessageExpr>(ASTLoc.getStmt());
@@ -181,7 +181,7 @@
 
       MsgD = Msg->getClassInfo().first;
       // FIXME: Case when we only have an identifier.
-      assert(MsgD && "Identifier only"); 
+      assert(MsgD && "Identifier only");
     }
 
     assert(MsgD);
@@ -233,7 +233,7 @@
   /// \brief Super classes of the ObjCInterface.
   typedef llvm::SmallSet<Entity, 16> EntitiesSetTy;
   EntitiesSetTy HierarchyEntities;
-  
+
   /// \brief The interface in the message interface hierarchy that "intercepts"
   /// the selector.
   Entity ReceiverIFaceEnt;
@@ -254,7 +254,7 @@
         CanBeClassMethod = true;
         MsgD = Msg->getClassInfo().first;
         // FIXME: Case when we only have an identifier.
-        assert(MsgD && "Identifier only"); 
+        assert(MsgD && "Identifier only");
         break;
       }
 
@@ -276,7 +276,7 @@
       CanBeInstanceMethod = true;
       break;
     }
-    
+
     assert(CanBeInstanceMethod || CanBeClassMethod);
 
     Selector sel = Msg->getSelector();
@@ -304,7 +304,7 @@
               break;
             }
         }
-        
+
         if (isReceiver) {
           ReceiverIFaceEnt = Entity::get(Cls, Prog);
           break;
@@ -312,7 +312,7 @@
       }
     }
   }
-  
+
   virtual void Handle(TranslationUnit *TU) {
     assert(TU && "Passed null translation unit");
     ASTContext &Ctx = TU->getASTContext();
@@ -406,7 +406,7 @@
   Entity Ent = Entity::get(D, Prog);
   if (Ent.isInvalid())
     return;
-  
+
   DeclEntityAnalyzer DEA(Ent, Handler);
   Idxer.GetTranslationUnitsFor(Ent, DEA);
 }
@@ -423,7 +423,7 @@
   Entity Ent = Entity::get(D, Prog);
   if (Ent.isInvalid())
     return;
-  
+
   RefEntityAnalyzer REA(Ent, Handler);
   Idxer.GetTranslationUnitsFor(Ent, REA);
 }
diff --git a/lib/Index/DeclReferenceMap.cpp b/lib/Index/DeclReferenceMap.cpp
index 1e6ae21..0aee2a4 100644
--- a/lib/Index/DeclReferenceMap.cpp
+++ b/lib/Index/DeclReferenceMap.cpp
@@ -63,16 +63,16 @@
 DeclReferenceMap::astlocation_iterator
 DeclReferenceMap::refs_begin(NamedDecl *D) const {
   NamedDecl *Prim = cast<NamedDecl>(D->getCanonicalDecl());
-  return astlocation_iterator(Map.lower_bound(Prim));  
+  return astlocation_iterator(Map.lower_bound(Prim));
 }
 
 DeclReferenceMap::astlocation_iterator
 DeclReferenceMap::refs_end(NamedDecl *D) const {
   NamedDecl *Prim = cast<NamedDecl>(D->getCanonicalDecl());
-  return astlocation_iterator(Map.upper_bound(Prim));  
+  return astlocation_iterator(Map.upper_bound(Prim));
 }
 
 bool DeclReferenceMap::refs_empty(NamedDecl *D) const {
   NamedDecl *Prim = cast<NamedDecl>(D->getCanonicalDecl());
-  return refs_begin(Prim) == refs_end(Prim);  
+  return refs_begin(Prim) == refs_end(Prim);
 }
diff --git a/lib/Index/Entity.cpp b/lib/Index/Entity.cpp
index 245fc9a..77d7a84 100644
--- a/lib/Index/Entity.cpp
+++ b/lib/Index/Entity.cpp
@@ -41,10 +41,10 @@
 public:
   EntityGetter(Program &prog, ProgramImpl &progImpl)
     : Prog(prog), ProgImpl(progImpl) { }
-  
+
   Entity VisitNamedDecl(NamedDecl *D);
   Entity VisitVarDecl(VarDecl *D);
-  Entity VisitFunctionDecl(FunctionDecl *D); 
+  Entity VisitFunctionDecl(FunctionDecl *D);
 };
 
 }
@@ -80,12 +80,12 @@
     // Treats other DeclarationNames as internal Decls for now..
     if (LocalSel.isNull())
       return Entity(D);
-    
+
     Selector GlobSel =
         (uintptr_t)GlobalSelector::get(LocalSel, Prog).getAsOpaquePtr();
     GlobName = DeclarationName(GlobSel);
   }
-  
+
   assert(GlobName);
 
   unsigned IdNS = D->getIdentifierNamespace();
@@ -105,7 +105,7 @@
   EntityImpl *New =
       new (Buf) EntityImpl(Parent, GlobName, IdNS, isObjCInstanceMethod);
   Entities.InsertNode(New, InsertPos);
-  
+
   return Entity(New);
 }
 
@@ -113,7 +113,7 @@
   // If it's static it cannot be referred to by another translation unit.
   if (D->getStorageClass() == VarDecl::Static)
     return Entity(D);
-  
+
   return VisitNamedDecl(D);
 }
 
@@ -121,7 +121,7 @@
   // If it's static it cannot be refered to by another translation unit.
   if (D->getStorageClass() == FunctionDecl::Static)
     return Entity(D);
-  
+
   return VisitNamedDecl(D);
 }
 
@@ -188,18 +188,18 @@
 Decl *Entity::getDecl(ASTContext &AST) const {
   if (isInvalid())
     return 0;
-  
+
   if (Decl *D = Val.dyn_cast<Decl *>())
     // Check that the passed AST is actually the one that this Decl belongs to.
     return (&D->getASTContext() == &AST) ? D : 0;
-  
+
   return Val.get<EntityImpl *>()->getDecl(AST);
 }
 
 std::string Entity::getPrintableName() const {
   if (isInvalid())
     return "<< Invalid >>";
-  
+
   if (Decl *D = Val.dyn_cast<Decl *>()) {
     if (NamedDecl *ND = dyn_cast<NamedDecl>(D))
       return ND->getNameAsString();
@@ -219,7 +219,7 @@
   return EntityImpl::get(D, Prog, ProgImpl);
 }
 
-unsigned 
+unsigned
 llvm::DenseMapInfo<Entity>::getHashValue(Entity E) {
   return DenseMapInfo<void*>::getHashValue(E.getAsOpaquePtr());
 }
diff --git a/lib/Index/EntityImpl.h b/lib/Index/EntityImpl.h
index b4a883a..cbce934 100644
--- a/lib/Index/EntityImpl.h
+++ b/lib/Index/EntityImpl.h
@@ -30,7 +30,7 @@
 
   /// \brief Identifier namespace.
   unsigned IdNS;
-  
+
   /// \brief If Name is a selector, this keeps track whether it's for an
   /// instance method.
   bool IsObjCInstanceMethod;
@@ -47,7 +47,7 @@
   /// \brief Get an Entity associated with the given Decl.
   /// \returns Null if an Entity cannot refer to this Decl.
   static Entity get(Decl *D, Program &Prog, ProgramImpl &ProgImpl);
-  
+
   std::string getPrintableName();
 
   void Profile(llvm::FoldingSetNodeID &ID) const {
diff --git a/lib/Index/GlobalSelector.cpp b/lib/Index/GlobalSelector.cpp
index a1ec929..f3ec41d 100644
--- a/lib/Index/GlobalSelector.cpp
+++ b/lib/Index/GlobalSelector.cpp
@@ -41,7 +41,7 @@
 std::string GlobalSelector::getPrintableName() const {
   if (isInvalid())
     return "<< Invalid >>";
-  
+
   Selector GlobSel = Selector(reinterpret_cast<uintptr_t>(Val));
   return GlobSel.getAsString();
 }
@@ -67,7 +67,7 @@
   return GlobalSelector(GlobSel.getAsOpaquePtr());
 }
 
-unsigned 
+unsigned
 llvm::DenseMapInfo<GlobalSelector>::getHashValue(GlobalSelector Sel) {
   return DenseMapInfo<void*>::getHashValue(Sel.getAsOpaquePtr());
 }
diff --git a/lib/Index/Indexer.cpp b/lib/Index/Indexer.cpp
index 75dfbd5..57bfc5b 100644
--- a/lib/Index/Indexer.cpp
+++ b/lib/Index/Indexer.cpp
@@ -25,7 +25,7 @@
 class EntityIndexer : public EntityHandler {
   TranslationUnit *TU;
   Indexer::MapTy &Map;
-  
+
 public:
   EntityIndexer(TranslationUnit *tu, Indexer::MapTy &map) : TU(tu), Map(map) { }
 
@@ -64,7 +64,7 @@
   CtxTUMap[&Ctx] = TU;
   EntityIndexer Idx(TU, Map);
   Prog.FindEntities(Ctx, Idx);
-  
+
   SelectorIndexer SelIdx(Prog, TU, SelMap);
   SelIdx.Visit(Ctx.getTranslationUnitDecl());
 }
@@ -84,7 +84,7 @@
   MapTy::iterator I = Map.find(Ent);
   if (I == Map.end())
     return;
-  
+
   TUSetTy &Set = I->second;
   for (TUSetTy::iterator I = Set.begin(), E = Set.end(); I != E; ++I)
     Handler.Handle(*I);
@@ -97,7 +97,7 @@
   SelMapTy::iterator I = SelMap.find(Sel);
   if (I == SelMap.end())
     return;
-  
+
   TUSetTy &Set = I->second;
   for (TUSetTy::iterator I = Set.begin(), E = Set.end(); I != E; ++I)
     Handler.Handle(*I);
diff --git a/lib/Index/ProgramImpl.h b/lib/Index/ProgramImpl.h
index 1fbff9b..57b9ce3 100644
--- a/lib/Index/ProgramImpl.h
+++ b/lib/Index/ProgramImpl.h
@@ -30,16 +30,16 @@
 private:
   EntitySetTy Entities;
   llvm::BumpPtrAllocator BumpAlloc;
-  
+
   IdentifierTable Identifiers;
   SelectorTable Selectors;
 
   ProgramImpl(const ProgramImpl&); // do not implement
   ProgramImpl &operator=(const ProgramImpl &); // do not implement
-  
+
 public:
   ProgramImpl() : Identifiers(LangOptions()) { }
-  
+
   EntitySetTy &getEntities() { return Entities; }
   IdentifierTable &getIdents() { return Identifiers; }
   SelectorTable &getSelectors() { return Selectors; }
diff --git a/lib/Index/ResolveLocation.cpp b/lib/Index/ResolveLocation.cpp
index ce8512d..281f4d9 100644
--- a/lib/Index/ResolveLocation.cpp
+++ b/lib/Index/ResolveLocation.cpp
@@ -119,7 +119,7 @@
   Nodes.push_back(Node->getArg(0));
   Nodes.push_back(Node->getCallee());
   Nodes.push_back(Node->getArg(1));
-  
+
   for (unsigned i = 0, e = Nodes.size(); i != e; ++i) {
     RangePos RP = CheckRange(Nodes[i]);
     if (RP == AfterLoc)
@@ -201,9 +201,9 @@
     if (RP == ContainsLoc)
       return Visit(*I);
   }
-  
+
   // We didn't find the location in the parameters and we didn't get passed it.
-  
+
   if (!D->isThisDeclarationADefinition())
     return ASTLocation(D);
 
@@ -214,7 +214,7 @@
          I = D->decls_begin(), E = D->decls_end(); I != E; ++I) {
     if (isa<ParmVarDecl>(*I))
       continue; // We already searched through the parameters.
-    
+
     RangePos RP = CheckRange(*I);
     if (RP == AfterLoc)
       break;
@@ -223,7 +223,7 @@
   }
 
   // We didn't find a declaration that corresponds to the source location.
-  
+
   // Finally, search through the body of the function.
   Stmt *Body = D->getBody();
   assert(Body && "Expected definition");
@@ -325,10 +325,10 @@
                                                Ctx.getLangOptions());
   Range.setEnd(Range.getEnd().getFileLocWithOffset(TokSize-1));
 
-  SourceManager &SourceMgr = Ctx.getSourceManager(); 
+  SourceManager &SourceMgr = Ctx.getSourceManager();
   if (SourceMgr.isBeforeInTranslationUnit(Range.getEnd(), Loc))
     return BeforeLoc;
-  
+
   if (SourceMgr.isBeforeInTranslationUnit(Loc, Range.getBegin()))
     return AfterLoc;
 
@@ -367,6 +367,6 @@
 ASTLocation idx::ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc) {
   if (Loc.isInvalid())
     return ASTLocation();
-  
+
   return DeclLocResolver(Ctx, Loc).Visit(Ctx.getTranslationUnitDecl());
 }