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/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index f4d06c0..e7321bf 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -69,21 +69,21 @@
   PARSE_LANGOPT_IMPORTANT(ObjCNonFragileABI, diag::warn_pch_nonfragile_abi);
   PARSE_LANGOPT_BENIGN(PascalStrings);
   PARSE_LANGOPT_BENIGN(WritableStrings);
-  PARSE_LANGOPT_IMPORTANT(LaxVectorConversions, 
+  PARSE_LANGOPT_IMPORTANT(LaxVectorConversions,
                           diag::warn_pch_lax_vector_conversions);
   PARSE_LANGOPT_IMPORTANT(AltiVec, diag::warn_pch_altivec);
   PARSE_LANGOPT_IMPORTANT(Exceptions, diag::warn_pch_exceptions);
   PARSE_LANGOPT_IMPORTANT(NeXTRuntime, diag::warn_pch_objc_runtime);
   PARSE_LANGOPT_IMPORTANT(Freestanding, diag::warn_pch_freestanding);
   PARSE_LANGOPT_IMPORTANT(NoBuiltin, diag::warn_pch_builtins);
-  PARSE_LANGOPT_IMPORTANT(ThreadsafeStatics, 
+  PARSE_LANGOPT_IMPORTANT(ThreadsafeStatics,
                           diag::warn_pch_thread_safe_statics);
   PARSE_LANGOPT_IMPORTANT(POSIXThreads, diag::warn_pch_posix_threads);
   PARSE_LANGOPT_IMPORTANT(Blocks, diag::warn_pch_blocks);
   PARSE_LANGOPT_BENIGN(EmitAllDecls);
   PARSE_LANGOPT_IMPORTANT(MathErrno, diag::warn_pch_math_errno);
   PARSE_LANGOPT_IMPORTANT(OverflowChecking, diag::warn_pch_overflow_checking);
-  PARSE_LANGOPT_IMPORTANT(HeinousExtensions, 
+  PARSE_LANGOPT_IMPORTANT(HeinousExtensions,
                           diag::warn_pch_heinous_extensions);
   // FIXME: Most of the options below are benign if the macro wasn't
   // used. Unfortunately, this means that a PCH compiled without
@@ -101,7 +101,7 @@
   PARSE_LANGOPT_IMPORTANT(AccessControl, diag::warn_pch_access_control);
   PARSE_LANGOPT_IMPORTANT(CharIsSigned, diag::warn_pch_char_signed);
   if ((PPLangOpts.getGCMode() != 0) != (LangOpts.getGCMode() != 0)) {
-    Reader.Diag(diag::warn_pch_gc_mode) 
+    Reader.Diag(diag::warn_pch_gc_mode)
       << LangOpts.getGCMode() << PPLangOpts.getGCMode();
     return true;
   }
@@ -165,7 +165,7 @@
   return startsWith(Haystack, Needle.c_str());
 }
 
-bool PCHValidator::ReadPredefinesBuffer(const char *PCHPredef, 
+bool PCHValidator::ReadPredefinesBuffer(const char *PCHPredef,
                                         unsigned PCHPredefLen,
                                         FileID PCHBufferID,
                                         std::string &SuggestedPredefines) {
@@ -173,19 +173,19 @@
   unsigned PredefLen = PP.getPredefines().size();
 
   // If the two predefines buffers compare equal, we're done!
-  if (PredefLen == PCHPredefLen && 
+  if (PredefLen == PCHPredefLen &&
       strncmp(Predef, PCHPredef, PCHPredefLen) == 0)
     return false;
 
   SourceManager &SourceMgr = PP.getSourceManager();
-  
+
   // The predefines buffers are different. Determine what the
   // differences are, and whether they require us to reject the PCH
   // file.
   std::vector<std::string> CmdLineLines = splitLines(Predef, PredefLen);
   std::vector<std::string> PCHLines = splitLines(PCHPredef, PCHPredefLen);
 
-  // Sort both sets of predefined buffer lines, since 
+  // Sort both sets of predefined buffer lines, since
   std::sort(CmdLineLines.begin(), CmdLineLines.end());
   std::sort(PCHLines.begin(), PCHLines.end());
 
@@ -204,11 +204,11 @@
       Reader.Diag(diag::warn_pch_compiler_options_mismatch);
       return true;
     }
-    
+
     // This is a macro definition. Determine the name of the macro
     // we're defining.
     std::string::size_type StartOfMacroName = strlen("#define ");
-    std::string::size_type EndOfMacroName 
+    std::string::size_type EndOfMacroName
       = Missing.find_first_of("( \n\r", StartOfMacroName);
     assert(EndOfMacroName != std::string::npos &&
            "Couldn't find the end of the macro name");
@@ -226,19 +226,19 @@
       if (!startsWith(*ConflictPos, MacroDefStart)) {
         // Different macro; we're done.
         ConflictPos = CmdLineLines.end();
-        break; 
+        break;
       }
-      
-      assert(ConflictPos->size() > MacroDefLen && 
+
+      assert(ConflictPos->size() > MacroDefLen &&
              "Invalid #define in predefines buffer?");
-      if ((*ConflictPos)[MacroDefLen] != ' ' && 
+      if ((*ConflictPos)[MacroDefLen] != ' ' &&
           (*ConflictPos)[MacroDefLen] != '(')
         continue; // Longer macro name; keep trying.
-      
+
       // We found a conflicting macro definition.
       break;
     }
-    
+
     if (ConflictPos != CmdLineLines.end()) {
       Reader.Diag(diag::warn_cmdline_conflicting_macro_def)
           << MacroName;
@@ -255,13 +255,13 @@
       ConflictingDefines = true;
       continue;
     }
-    
+
     // If the macro doesn't conflict, then we'll just pick up the
     // macro definition from the PCH file. Warn the user that they
     // made a mistake.
     if (ConflictingDefines)
       continue; // Don't complain if there are already conflicting defs
-    
+
     if (!MissingDefines) {
       Reader.Diag(diag::warn_cmdline_missing_macro_defs);
       MissingDefines = true;
@@ -275,10 +275,10 @@
       .getFileLocWithOffset(Offset);
     Reader.Diag(PCHMissingLoc, diag::note_using_macro_def_from_pch);
   }
-  
+
   if (ConflictingDefines)
     return true;
-  
+
   // Determine what predefines were introduced based on command-line
   // parameters that were not present when building the PCH
   // file. Extra #defines are okay, so long as the identifiers being
@@ -286,7 +286,7 @@
   std::vector<std::string> ExtraPredefines;
   std::set_difference(CmdLineLines.begin(), CmdLineLines.end(),
                       PCHLines.begin(), PCHLines.end(),
-                      std::back_inserter(ExtraPredefines));  
+                      std::back_inserter(ExtraPredefines));
   for (unsigned I = 0, N = ExtraPredefines.size(); I != N; ++I) {
     const std::string &Extra = ExtraPredefines[I];
     if (!startsWith(Extra, "#define ") != 0) {
@@ -297,7 +297,7 @@
     // This is an extra macro definition. Determine the name of the
     // macro we're defining.
     std::string::size_type StartOfMacroName = strlen("#define ");
-    std::string::size_type EndOfMacroName 
+    std::string::size_type EndOfMacroName
       = Extra.find_first_of("( \n\r", StartOfMacroName);
     assert(EndOfMacroName != std::string::npos &&
            "Couldn't find the end of the macro name");
@@ -338,8 +338,8 @@
 // PCH reader implementation
 //===----------------------------------------------------------------------===//
 
-PCHReader::PCHReader(Preprocessor &PP, ASTContext *Context, 
-                     const char *isysroot) 
+PCHReader::PCHReader(Preprocessor &PP, ASTContext *Context,
+                     const char *isysroot)
   : Listener(new PCHValidator(PP, *this)), SourceMgr(PP.getSourceManager()),
     FileMgr(PP.getFileManager()), Diags(PP.getDiagnostics()),
     SemaObj(0), PP(&PP), Context(Context), Consumer(0),
@@ -348,16 +348,16 @@
     MethodPoolLookupTable(0), MethodPoolLookupTableData(0),
     TotalSelectorsInMethodPool(0), SelectorOffsets(0),
     TotalNumSelectors(0), Comments(0), NumComments(0), isysroot(isysroot),
-    NumStatHits(0), NumStatMisses(0), 
-    NumSLocEntriesRead(0), NumStatementsRead(0), 
+    NumStatHits(0), NumStatMisses(0),
+    NumSLocEntriesRead(0), NumStatementsRead(0),
     NumMacrosRead(0), NumMethodPoolSelectorsRead(0), NumMethodPoolMisses(0),
     NumLexicalDeclContextsRead(0), NumVisibleDeclContextsRead(0),
-    CurrentlyLoadingTypeOrDecl(0) { 
+    CurrentlyLoadingTypeOrDecl(0) {
   RelocatablePCH = false;
 }
 
 PCHReader::PCHReader(SourceManager &SourceMgr, FileManager &FileMgr,
-                     Diagnostic &Diags, const char *isysroot) 
+                     Diagnostic &Diags, const char *isysroot)
   : SourceMgr(SourceMgr), FileMgr(FileMgr), Diags(Diags),
     SemaObj(0), PP(0), Context(0), Consumer(0),
     IdentifierTableData(0), IdentifierLookupTable(0),
@@ -365,11 +365,11 @@
     MethodPoolLookupTable(0), MethodPoolLookupTableData(0),
     TotalSelectorsInMethodPool(0), SelectorOffsets(0),
     TotalNumSelectors(0), Comments(0), NumComments(0), isysroot(isysroot),
-    NumStatHits(0), NumStatMisses(0), 
-    NumSLocEntriesRead(0), NumStatementsRead(0), 
+    NumStatHits(0), NumStatMisses(0),
+    NumSLocEntriesRead(0), NumStatementsRead(0),
     NumMacrosRead(0), NumMethodPoolSelectorsRead(0), NumMethodPoolMisses(0),
     NumLexicalDeclContextsRead(0), NumVisibleDeclContextsRead(0),
-    CurrentlyLoadingTypeOrDecl(0) { 
+    CurrentlyLoadingTypeOrDecl(0) {
   RelocatablePCH = false;
 }
 
@@ -395,12 +395,12 @@
   typedef external_key_type internal_key_type;
 
   explicit PCHMethodPoolLookupTrait(PCHReader &Reader) : Reader(Reader) { }
-  
+
   static bool EqualKey(const internal_key_type& a,
                        const internal_key_type& b) {
     return a == b;
   }
-  
+
   static unsigned ComputeHash(Selector Sel) {
     unsigned N = Sel.getNumArgs();
     if (N == 0)
@@ -411,11 +411,11 @@
         R = clang::BernsteinHashPartial(II->getName(), II->getLength(), R);
     return R;
   }
-  
+
   // This hopefully will just get inlined and removed by the optimizer.
   static const internal_key_type&
   GetInternalKey(const external_key_type& x) { return x; }
-  
+
   static std::pair<unsigned, unsigned>
   ReadKeyDataLength(const unsigned char*& d) {
     using namespace clang::io;
@@ -423,12 +423,12 @@
     unsigned DataLen = ReadUnalignedLE16(d);
     return std::make_pair(KeyLen, DataLen);
   }
-    
+
   internal_key_type ReadKey(const unsigned char* d, unsigned) {
     using namespace clang::io;
     SelectorTable &SelTable = Reader.getContext()->Selectors;
     unsigned N = ReadUnalignedLE16(d);
-    IdentifierInfo *FirstII 
+    IdentifierInfo *FirstII
       = Reader.DecodeIdentifierInfo(ReadUnalignedLE32(d));
     if (N == 0)
       return SelTable.getNullarySelector(FirstII);
@@ -442,7 +442,7 @@
 
     return SelTable.getSelector(N, Args.data());
   }
-    
+
   data_type ReadData(Selector, const unsigned char* d, unsigned DataLen) {
     using namespace clang::io;
     unsigned NumInstanceMethods = ReadUnalignedLE16(d);
@@ -453,7 +453,7 @@
     // Load instance methods
     ObjCMethodList *Prev = 0;
     for (unsigned I = 0; I != NumInstanceMethods; ++I) {
-      ObjCMethodDecl *Method 
+      ObjCMethodDecl *Method
         = cast<ObjCMethodDecl>(Reader.GetDecl(ReadUnalignedLE32(d)));
       if (!Result.first.Method) {
         // This is the first method, which is the easy case.
@@ -469,7 +469,7 @@
     // Load factory methods
     Prev = 0;
     for (unsigned I = 0; I != NumFactoryMethods; ++I) {
-      ObjCMethodDecl *Method 
+      ObjCMethodDecl *Method
         = cast<ObjCMethodDecl>(Reader.GetDecl(ReadUnalignedLE32(d)));
       if (!Result.second.Method) {
         // This is the first method, which is the easy case.
@@ -485,11 +485,11 @@
     return Result;
   }
 };
-  
-} // end anonymous namespace  
+
+} // end anonymous namespace
 
 /// \brief The on-disk hash table used for the global method pool.
-typedef OnDiskChainedHashTable<PCHMethodPoolLookupTrait> 
+typedef OnDiskChainedHashTable<PCHMethodPoolLookupTrait>
   PCHMethodPoolLookupTable;
 
 namespace {
@@ -508,23 +508,23 @@
 
   typedef external_key_type internal_key_type;
 
-  explicit PCHIdentifierLookupTrait(PCHReader &Reader, IdentifierInfo *II = 0) 
+  explicit PCHIdentifierLookupTrait(PCHReader &Reader, IdentifierInfo *II = 0)
     : Reader(Reader), KnownII(II) { }
-  
+
   static bool EqualKey(const internal_key_type& a,
                        const internal_key_type& b) {
     return (a.second == b.second) ? memcmp(a.first, b.first, a.second) == 0
                                   : false;
   }
-  
+
   static unsigned ComputeHash(const internal_key_type& a) {
     return BernsteinHash(a.first, a.second);
   }
-  
+
   // This hopefully will just get inlined and removed by the optimizer.
   static const internal_key_type&
   GetInternalKey(const external_key_type& x) { return x; }
-  
+
   static std::pair<unsigned, unsigned>
   ReadKeyDataLength(const unsigned char*& d) {
     using namespace clang::io;
@@ -532,14 +532,14 @@
     unsigned KeyLen = ReadUnalignedLE16(d);
     return std::make_pair(KeyLen, DataLen);
   }
-    
+
   static std::pair<const char*, unsigned>
   ReadKey(const unsigned char* d, unsigned n) {
     assert(n >= 2 && d[n-1] == '\0');
     return std::make_pair((const char*) d, n-1);
   }
-    
-  IdentifierInfo *ReadData(const internal_key_type& k, 
+
+  IdentifierInfo *ReadData(const internal_key_type& k,
                            const unsigned char* d,
                            unsigned DataLen) {
     using namespace clang::io;
@@ -571,7 +571,7 @@
     Bits >>= 1;
     unsigned ObjCOrBuiltinID = Bits & 0x3FF;
     Bits >>= 10;
-    
+
     assert(Bits == 0 && "Extra bits in the identifier?");
     DataLen -= 6;
 
@@ -586,7 +586,7 @@
     // Set or check the various bits in the IdentifierInfo structure.
     // FIXME: Load token IDs lazily, too?
     II->setObjCOrBuiltinID(ObjCOrBuiltinID);
-    assert(II->isExtensionToken() == ExtensionToken && 
+    assert(II->isExtensionToken() == ExtensionToken &&
            "Incorrect extension token flag");
     (void)ExtensionToken;
     II->setIsPoisoned(Poisoned);
@@ -611,16 +611,16 @@
         DeclIDs.push_back(ReadUnalignedLE32(d));
       Reader.SetGloballyVisibleDecls(II, DeclIDs);
     }
-    
+
     return II;
   }
 };
-  
-} // end anonymous namespace  
+
+} // end anonymous namespace
 
 /// \brief The on-disk hash table used to contain information about
 /// all of the identifiers in the program.
-typedef OnDiskChainedHashTable<PCHIdentifierLookupTrait> 
+typedef OnDiskChainedHashTable<PCHIdentifierLookupTrait>
   PCHIdentifierLookupTable;
 
 bool PCHReader::Error(const char *Msg) {
@@ -646,7 +646,7 @@
 ///
 /// \returns true if there was a mismatch (in which case the PCH file
 /// should be ignored), or false otherwise.
-bool PCHReader::CheckPredefinesBuffer(const char *PCHPredef, 
+bool PCHReader::CheckPredefinesBuffer(const char *PCHPredef,
                                       unsigned PCHPredefLen,
                                       FileID PCHBufferID) {
   if (Listener)
@@ -673,7 +673,7 @@
     std::string Filename(&Record[Idx], &Record[Idx] + FilenameLen);
     Idx += FilenameLen;
     MaybeAddSystemRootToFilename(Filename);
-    FileIDs[I] = LineTable.getLineTableFilenameID(Filename.c_str(), 
+    FileIDs[I] = LineTable.getLineTableFilenameID(Filename.c_str(),
                                                   Filename.size());
   }
 
@@ -690,7 +690,7 @@
       unsigned FileOffset = Record[Idx++];
       unsigned LineNo = Record[Idx++];
       int FilenameID = Record[Idx++];
-      SrcMgr::CharacteristicKind FileKind 
+      SrcMgr::CharacteristicKind FileKind
         = (SrcMgr::CharacteristicKind)Record[Idx++];
       unsigned IncludeOffset = Record[Idx++];
       Entries.push_back(LineEntry::get(FileOffset, LineNo, FilenameID,
@@ -712,10 +712,10 @@
   const mode_t mode;
   const time_t mtime;
   const off_t size;
-  
+
   PCHStatData(ino_t i, dev_t d, mode_t mo, time_t m, off_t s)
-  : hasStat(true), ino(i), dev(d), mode(mo), mtime(m), size(s) {}  
-  
+  : hasStat(true), ino(i), dev(d), mode(mo), mtime(m), size(s) {}
+
   PCHStatData()
     : hasStat(false), ino(0), dev(0), mode(0), mtime(0), size(0) {}
 };
@@ -758,7 +758,7 @@
     ino_t ino = (ino_t) ReadUnalignedLE32(d);
     dev_t dev = (dev_t) ReadUnalignedLE32(d);
     mode_t mode = (mode_t) ReadUnalignedLE16(d);
-    time_t mtime = (time_t) ReadUnalignedLE64(d);    
+    time_t mtime = (time_t) ReadUnalignedLE64(d);
     off_t size = (off_t) ReadUnalignedLE64(d);
     return data_type(ino, dev, mode, mtime, size);
   }
@@ -773,17 +773,17 @@
   CacheTy *Cache;
 
   unsigned &NumStatHits, &NumStatMisses;
-public:  
+public:
   PCHStatCache(const unsigned char *Buckets,
                const unsigned char *Base,
                unsigned &NumStatHits,
-               unsigned &NumStatMisses) 
+               unsigned &NumStatMisses)
     : Cache(0), NumStatHits(NumStatHits), NumStatMisses(NumStatMisses) {
     Cache = CacheTy::Create(Buckets, Base);
   }
 
   ~PCHStatCache() { delete Cache; }
-  
+
   int stat(const char *path, struct stat *buf) {
     // Do the lookup for the file's data in the PCH file.
     CacheTy::iterator I = Cache->find(path);
@@ -793,10 +793,10 @@
       ++NumStatMisses;
       return ::stat(path, buf);
     }
-    
+
     ++NumStatHits;
     PCHStatData Data = *I;
-    
+
     if (!Data.hasStat)
       return 1;
 
@@ -843,7 +843,7 @@
       }
       return Success;
     }
-    
+
     if (Code == llvm::bitc::ENTER_SUBBLOCK) {
       // No known subblocks, always skip them.
       SLocEntryCursor.ReadSubBlockID();
@@ -853,12 +853,12 @@
       }
       continue;
     }
-    
+
     if (Code == llvm::bitc::DEFINE_ABBREV) {
       SLocEntryCursor.ReadAbbrevRecord();
       continue;
     }
-    
+
     // Read a record.
     const char *BlobStart;
     unsigned BlobLen;
@@ -931,7 +931,7 @@
       Error(ErrorStr.c_str());
       return Failure;
     }
-    
+
     FileID FID = SourceMgr.createFileID(File,
                                 SourceLocation::getFromRawEncoding(Record[1]),
                                        (SrcMgr::CharacteristicKind)Record[2],
@@ -948,16 +948,16 @@
     unsigned Offset = Record[0];
     unsigned Code = SLocEntryCursor.ReadCode();
     Record.clear();
-    unsigned RecCode 
+    unsigned RecCode
       = SLocEntryCursor.ReadRecord(Code, Record, &BlobStart, &BlobLen);
     assert(RecCode == pch::SM_SLOC_BUFFER_BLOB && "Ill-formed PCH file");
     (void)RecCode;
     llvm::MemoryBuffer *Buffer
-      = llvm::MemoryBuffer::getMemBuffer(BlobStart, 
+      = llvm::MemoryBuffer::getMemBuffer(BlobStart,
                                          BlobStart + BlobLen - 1,
                                          Name);
     FileID BufferID = SourceMgr.createFileIDForMemBuffer(Buffer, ID, Offset);
-      
+
     if (strcmp(Name, "<built-in>") == 0) {
       PCHPredefinesBufferID = BufferID;
       PCHPredefines = BlobStart;
@@ -968,7 +968,7 @@
   }
 
   case pch::SM_SLOC_INSTANTIATION_ENTRY: {
-    SourceLocation SpellingLoc 
+    SourceLocation SpellingLoc
       = SourceLocation::getFromRawEncoding(Record[1]);
     SourceMgr.createInstantiationLoc(SpellingLoc,
                               SourceLocation::getFromRawEncoding(Record[2]),
@@ -977,7 +977,7 @@
                                      ID,
                                      Record[0]);
     break;
-  }  
+  }
   }
 
   return Success;
@@ -992,10 +992,10 @@
     Error("malformed block record in PCH file");
     return Failure;
   }
-  
+
   while (true) {
     unsigned Code = Cursor.ReadCode();
-    
+
     // We expect all abbrevs to be at the start of the block.
     if (Code != llvm::bitc::DEFINE_ABBREV)
       return false;
@@ -1005,7 +1005,7 @@
 
 void PCHReader::ReadMacroRecord(uint64_t Offset) {
   assert(PP && "Forgot to set Preprocessor ?");
-  
+
   // Keep track of where we are in the stream, then jump back there
   // after reading this macro.
   SavedStreamPosition SavedPosition(Stream);
@@ -1014,7 +1014,7 @@
   RecordData Record;
   llvm::SmallVector<IdentifierInfo*, 16> MacroArgs;
   MacroInfo *Macro = 0;
-  
+
   while (true) {
     unsigned Code = Stream.ReadCode();
     switch (Code) {
@@ -1029,7 +1029,7 @@
         return;
       }
       continue;
-    
+
     case llvm::bitc::DEFINE_ABBREV:
       Stream.ReadAbbrevRecord();
       continue;
@@ -1056,10 +1056,10 @@
       }
       SourceLocation Loc = SourceLocation::getFromRawEncoding(Record[1]);
       bool isUsed = Record[2];
-      
+
       MacroInfo *MI = PP->AllocateMacroInfo(Loc);
       MI->setIsUsed(isUsed);
-      
+
       if (RecType == pch::PP_MACRO_FUNCTION_LIKE) {
         // Decode function-like macro info.
         bool isC99VarArgs = Record[3];
@@ -1086,12 +1086,12 @@
       ++NumMacrosRead;
       break;
     }
-        
+
     case pch::PP_TOKEN: {
       // If we see a TOKEN before a PP_MACRO_*, then the file is
       // erroneous, just pretend we didn't see this.
       if (Macro == 0) break;
-      
+
       Token Tok;
       Tok.startToken();
       Tok.setLocation(SourceLocation::getFromRawEncoding(Record[0]));
@@ -1114,26 +1114,26 @@
   // If this is not a relocatable PCH file, there's nothing to do.
   if (!RelocatablePCH)
     return;
-  
+
   if (Filename.empty() || Filename[0] == '/' || Filename[0] == '<')
     return;
 
   std::string FIXME = Filename;
-  
+
   if (isysroot == 0) {
     // If no system root was given, default to '/'
     Filename.insert(Filename.begin(), '/');
     return;
   }
-  
+
   unsigned Length = strlen(isysroot);
   if (isysroot[Length - 1] != '/')
     Filename.insert(Filename.begin(), '/');
-    
+
   Filename.insert(Filename.begin(), isysroot, isysroot + Length);
 }
 
-PCHReader::PCHReadResult 
+PCHReader::PCHReadResult
 PCHReader::ReadPCHBlock() {
   if (Stream.EnterSubBlock(pch::PCH_BLOCK_ID)) {
     Error("malformed block record in PCH file");
@@ -1176,7 +1176,7 @@
           return Failure;
         }
         break;
-          
+
       case pch::PREPROCESSOR_BLOCK_ID:
         if (Stream.SkipBlock()) {
           Error("malformed block record in PCH file");
@@ -1210,7 +1210,7 @@
     Record.clear();
     const char *BlobStart = 0;
     unsigned BlobLen = 0;
-    switch ((pch::PCHRecordTypes)Stream.ReadRecord(Code, Record, 
+    switch ((pch::PCHRecordTypes)Stream.ReadRecord(Code, Record,
                                                    &BlobStart, &BlobLen)) {
     default:  // Default behavior: ignore.
       break;
@@ -1257,10 +1257,10 @@
     case pch::IDENTIFIER_TABLE:
       IdentifierTableData = BlobStart;
       if (Record[0]) {
-        IdentifierLookupTable 
+        IdentifierLookupTable
           = PCHIdentifierLookupTable::Create(
                         (const unsigned char *)IdentifierTableData + Record[0],
-                        (const unsigned char *)IdentifierTableData, 
+                        (const unsigned char *)IdentifierTableData,
                         PCHIdentifierLookupTrait(*this));
         if (PP)
           PP->getIdentifierTable().setExternalIdentifierLookup(this);
@@ -1322,10 +1322,10 @@
     case pch::METHOD_POOL:
       MethodPoolLookupTableData = (const unsigned char *)BlobStart;
       if (Record[0])
-        MethodPoolLookupTable 
+        MethodPoolLookupTable
           = PCHMethodPoolLookupTable::Create(
                         MethodPoolLookupTableData + Record[0],
-                        MethodPoolLookupTableData, 
+                        MethodPoolLookupTableData,
                         PCHMethodPoolLookupTrait(*this));
       TotalSelectorsInMethodPool = Record[1];
       break;
@@ -1338,8 +1338,8 @@
     case pch::SOURCE_LOCATION_OFFSETS:
       SLocOffsets = (const uint32_t *)BlobStart;
       TotalNumSLocEntries = Record[0];
-      SourceMgr.PreallocateSLocEntries(this, 
-                                                   TotalNumSLocEntries, 
+      SourceMgr.PreallocateSLocEntries(this,
+                                                   TotalNumSLocEntries,
                                                    Record[1]);
       break;
 
@@ -1370,7 +1370,7 @@
       OriginalFileName.assign(BlobStart, BlobLen);
       MaybeAddSystemRootToFilename(OriginalFileName);
       break;
-        
+
     case pch::COMMENT_RANGES:
       Comments = (SourceRange *)BlobStart;
       NumComments = BlobLen / sizeof(SourceRange);
@@ -1394,7 +1394,7 @@
   }
 
   // Initialize the stream
-  StreamFile.init((const unsigned char *)Buffer->getBufferStart(), 
+  StreamFile.init((const unsigned char *)Buffer->getBufferStart(),
                   (const unsigned char *)Buffer->getBufferEnd());
   Stream.init(StreamFile);
 
@@ -1409,7 +1409,7 @@
 
   while (!Stream.AtEndOfStream()) {
     unsigned Code = Stream.ReadCode();
-    
+
     if (Code != llvm::bitc::ENTER_SUBBLOCK) {
       Error("invalid record at top-level of PCH file");
       return Failure;
@@ -1455,13 +1455,13 @@
       }
       break;
     }
-  }  
-  
+  }
+
   // Check the predefines buffer.
-  if (CheckPredefinesBuffer(PCHPredefines, PCHPredefinesLen, 
+  if (CheckPredefinesBuffer(PCHPredefines, PCHPredefinesLen,
                             PCHPredefinesBufferID))
     return IgnorePCH;
-  
+
   if (PP) {
     // Initialization of keywords and pragmas occurs before the
     // PCH file is read, so there may be some identifiers that were
@@ -1480,7 +1480,7 @@
                                 IdEnd = PP->getIdentifierTable().end();
          Id != IdEnd; ++Id)
       Identifiers.push_back(Id->second);
-    PCHIdentifierLookupTable *IdTable 
+    PCHIdentifierLookupTable *IdTable
       = (PCHIdentifierLookupTable *)IdentifierLookupTable;
     for (unsigned I = 0, N = Identifiers.size(); I != N; ++I) {
       IdentifierInfo *II = Identifiers[I];
@@ -1490,7 +1490,7 @@
       PCHIdentifierLookupTable::iterator Pos = IdTable->find(Key, &Info);
       if (Pos == IdTable->end())
         continue;
-  
+
       // Dereferencing the iterator has the effect of populating the
       // IdentifierInfo node with the various declarations it needs.
       (void)*Pos;
@@ -1510,7 +1510,7 @@
   assert(PP && "Forgot to set Preprocessor ?");
   PP->getIdentifierTable().setExternalIdentifierLookup(this);
   PP->getHeaderSearchInfo().SetExternalLookup(this);
-  
+
   // Load the translation unit declaration
   ReadDeclRecord(DeclOffsets[0], 0);
 
@@ -1528,7 +1528,7 @@
 
   if (unsigned String = SpecialTypes[pch::SPECIAL_TYPE_CF_CONSTANT_STRING])
     Context->setCFConstantStringType(GetType(String));
-  if (unsigned FastEnum 
+  if (unsigned FastEnum
         = SpecialTypes[pch::SPECIAL_TYPE_OBJC_FAST_ENUMERATION_STATE])
     Context->setObjCFastEnumerationStateType(GetType(FastEnum));
   if (unsigned File = SpecialTypes[pch::SPECIAL_TYPE_FILE]) {
@@ -1564,10 +1564,10 @@
       Context->setsigjmp_bufDecl(Tag->getDecl());
     }
   }
-  if (unsigned ObjCIdRedef 
+  if (unsigned ObjCIdRedef
         = SpecialTypes[pch::SPECIAL_TYPE_OBJC_ID_REDEFINITION])
     Context->ObjCIdRedefinitionType = GetType(ObjCIdRedef);
-  if (unsigned ObjCClassRedef 
+  if (unsigned ObjCClassRedef
       = SpecialTypes[pch::SPECIAL_TYPE_OBJC_CLASS_REDEFINITION])
     Context->ObjCClassRedefinitionType = GetType(ObjCClassRedef);
 }
@@ -1588,7 +1588,7 @@
   // Initialize the stream
   llvm::BitstreamReader StreamFile;
   llvm::BitstreamCursor Stream;
-  StreamFile.init((const unsigned char *)Buffer->getBufferStart(), 
+  StreamFile.init((const unsigned char *)Buffer->getBufferStart(),
                   (const unsigned char *)Buffer->getBufferEnd());
   Stream.init(StreamFile);
 
@@ -1597,7 +1597,7 @@
       Stream.Read(8) != 'P' ||
       Stream.Read(8) != 'C' ||
       Stream.Read(8) != 'H') {
-    fprintf(stderr, 
+    fprintf(stderr,
             "error: '%s' does not appear to be a precompiled header file\n",
             PCHFileName.c_str());
     return std::string();
@@ -1606,10 +1606,10 @@
   RecordData Record;
   while (!Stream.AtEndOfStream()) {
     unsigned Code = Stream.ReadCode();
-    
+
     if (Code == llvm::bitc::ENTER_SUBBLOCK) {
       unsigned BlockID = Stream.ReadSubBlockID();
-      
+
       // We only know the PCH subblock ID.
       switch (BlockID) {
       case pch::PCH_BLOCK_ID:
@@ -1618,7 +1618,7 @@
           return std::string();
         }
         break;
-        
+
       default:
         if (Stream.SkipBlock()) {
           fprintf(stderr, "error: malformed block record in PCH file\n");
@@ -1645,10 +1645,10 @@
     Record.clear();
     const char *BlobStart = 0;
     unsigned BlobLen = 0;
-    if (Stream.ReadRecord(Code, Record, &BlobStart, &BlobLen) 
+    if (Stream.ReadRecord(Code, Record, &BlobStart, &BlobLen)
           == pch::ORIGINAL_FILE_NAME)
       return std::string(BlobStart, BlobLen);
-  }  
+  }
 
   return std::string();
 }
@@ -1671,11 +1671,11 @@
                              const llvm::SmallVectorImpl<uint64_t> &Record) {
   if (Listener) {
     LangOptions LangOpts;
-    
+
   #define PARSE_LANGOPT(Option)                  \
       LangOpts.Option = Record[Idx];             \
       ++Idx
-    
+
     unsigned Idx = 0;
     PARSE_LANGOPT(Trigraphs);
     PARSE_LANGOPT(BCPLComment);
@@ -1748,18 +1748,18 @@
 
   // Note that we are loading a type record.
   LoadingTypeOrDecl Loading(*this);
-  
+
   Stream.JumpToBit(Offset);
   RecordData Record;
   unsigned Code = Stream.ReadCode();
   switch ((pch::TypeCode)Stream.ReadRecord(Code, Record)) {
   case pch::TYPE_EXT_QUAL: {
-    assert(Record.size() == 3 && 
+    assert(Record.size() == 3 &&
            "Incorrect encoding of extended qualifier type");
     QualType Base = GetType(Record[0]);
     QualType::GCAttrTypes GCAttr = (QualType::GCAttrTypes)Record[1];
     unsigned AddressSpace = Record[2];
-    
+
     QualType T = Base;
     if (GCAttr != QualType::GCNone)
       T = Context->getObjCGCQualType(T, GCAttr);
@@ -1929,7 +1929,7 @@
     QualType UnderlyingType = GetType(Record[0]);
     return Context->getTypeOfType(UnderlyingType);
   }
-   
+
   case pch::TYPE_DECLTYPE:
     return Context->getDecltypeType(ReadTypeExpr());
 
@@ -1974,7 +1974,7 @@
 
 
 QualType PCHReader::GetType(pch::TypeID ID) {
-  unsigned Quals = ID & 0x07; 
+  unsigned Quals = ID & 0x07;
   unsigned Index = ID >> 3;
 
   if (Index < pch::NUM_PREDEF_TYPE_IDS) {
@@ -2023,7 +2023,7 @@
   //assert(Index < TypesLoaded.size() && "Type index out-of-range");
   if (!TypesLoaded[Index])
     TypesLoaded[Index] = ReadTypeRecord(TypeOffsets[Index]).getTypePtr();
-    
+
   return QualType(TypesLoaded[Index], Quals);
 }
 
@@ -2057,7 +2057,7 @@
 
 bool PCHReader::ReadDeclsLexicallyInContext(DeclContext *DC,
                                   llvm::SmallVectorImpl<pch::DeclID> &Decls) {
-  assert(DC->hasExternalLexicalStorage() && 
+  assert(DC->hasExternalLexicalStorage() &&
          "DeclContext has no lexical decls in storage");
   uint64_t Offset = DeclContextOffsets[DC].first;
   assert(Offset && "DeclContext has no lexical decls in storage");
@@ -2084,7 +2084,7 @@
 
 bool PCHReader::ReadDeclsVisibleInContext(DeclContext *DC,
                            llvm::SmallVectorImpl<VisibleDeclaration> &Decls) {
-  assert(DC->hasExternalVisibleStorage() && 
+  assert(DC->hasExternalVisibleStorage() &&
          "DeclContext has no visible decls in storage");
   uint64_t Offset = DeclContextOffsets[DC].second;
   assert(Offset && "DeclContext has no visible decls in storage");
@@ -2102,7 +2102,7 @@
   (void)RecCode;
   assert(RecCode == pch::DECL_CONTEXT_VISIBLE && "Expected visible block");
   if (Record.size() == 0)
-    return false;  
+    return false;
 
   Decls.clear();
 
@@ -2143,7 +2143,7 @@
 void PCHReader::PrintStats() {
   std::fprintf(stderr, "*** PCH Statistics:\n");
 
-  unsigned NumTypesLoaded 
+  unsigned NumTypesLoaded
     = TypesLoaded.size() - std::count(TypesLoaded.begin(), TypesLoaded.end(),
                                       (Type *)0);
   unsigned NumDeclsLoaded
@@ -2153,7 +2153,7 @@
     = IdentifiersLoaded.size() - std::count(IdentifiersLoaded.begin(),
                                             IdentifiersLoaded.end(),
                                             (IdentifierInfo *)0);
-  unsigned NumSelectorsLoaded 
+  unsigned NumSelectorsLoaded
     = SelectorsLoaded.size() - std::count(SelectorsLoaded.begin(),
                                           SelectorsLoaded.end(),
                                           Selector());
@@ -2245,7 +2245,7 @@
 
 IdentifierInfo* PCHReader::get(const char *NameStart, const char *NameEnd) {
   // Try to find this name within our on-disk hash table
-  PCHIdentifierLookupTable *IdTable 
+  PCHIdentifierLookupTable *IdTable
     = (PCHIdentifierLookupTable *)IdentifierLookupTable;
   std::pair<const char*, unsigned> Key(NameStart, NameEnd - NameStart);
   PCHIdentifierLookupTable::iterator Pos = IdTable->find(Key);
@@ -2258,7 +2258,7 @@
   return *Pos;
 }
 
-std::pair<ObjCMethodList, ObjCMethodList> 
+std::pair<ObjCMethodList, ObjCMethodList>
 PCHReader::ReadMethodPool(Selector Sel) {
   if (!MethodPoolLookupTable)
     return std::pair<ObjCMethodList, ObjCMethodList>();
@@ -2286,7 +2286,7 @@
 /// identifier.
 ///
 /// If the PCH reader is currently in a state where the given declaration IDs
-/// cannot safely be resolved, they are queued until it is safe to resolve 
+/// cannot safely be resolved, they are queued until it is safe to resolve
 /// them.
 ///
 /// \param II an IdentifierInfo that refers to one or more globally-visible
@@ -2298,8 +2298,8 @@
 /// \param Nonrecursive should be true to indicate that the caller knows that
 /// this call is non-recursive, and therefore the globally-visible declarations
 /// will not be placed onto the pending queue.
-void 
-PCHReader::SetGloballyVisibleDecls(IdentifierInfo *II, 
+void
+PCHReader::SetGloballyVisibleDecls(IdentifierInfo *II,
                               const llvm::SmallVectorImpl<uint32_t> &DeclIDs,
                                    bool Nonrecursive) {
   if (CurrentlyLoadingTypeOrDecl && !Nonrecursive) {
@@ -2310,7 +2310,7 @@
       PII.DeclIDs.push_back(DeclIDs[I]);
     return;
   }
-      
+
   for (unsigned I = 0, N = DeclIDs.size(); I != N; ++I) {
     NamedDecl *D = cast<NamedDecl>(GetDecl(DeclIDs[I]));
     if (SemaObj) {
@@ -2331,12 +2331,12 @@
 IdentifierInfo *PCHReader::DecodeIdentifierInfo(unsigned ID) {
   if (ID == 0)
     return 0;
-  
+
   if (!IdentifierTableData || IdentifiersLoaded.empty()) {
     Error("no identifier table in PCH file");
     return 0;
   }
-  
+
   assert(PP && "Forgot to set Preprocessor ?");
   if (!IdentifiersLoaded[ID - 1]) {
     uint32_t Offset = IdentifierOffsets[ID - 1];
@@ -2348,10 +2348,10 @@
     const char *StrLenPtr = Str - 2;
     unsigned StrLen = (((unsigned) StrLenPtr[0])
                        | (((unsigned) StrLenPtr[1]) << 8)) - 1;
-    IdentifiersLoaded[ID - 1] 
+    IdentifiersLoaded[ID - 1]
       = &PP->getIdentifierTable().get(Str, Str + StrLen);
   }
-  
+
   return IdentifiersLoaded[ID - 1];
 }
 
@@ -2362,7 +2362,7 @@
 Selector PCHReader::DecodeSelector(unsigned ID) {
   if (ID == 0)
     return Selector();
-  
+
   if (!MethodPoolLookupTableData)
     return Selector();
 
@@ -2376,14 +2376,14 @@
     // Load this selector from the selector table.
     // FIXME: endianness portability issues with SelectorOffsets table
     PCHMethodPoolLookupTrait Trait(*this);
-    SelectorsLoaded[Index] 
+    SelectorsLoaded[Index]
       = Trait.ReadKey(MethodPoolLookupTableData + SelectorOffsets[Index], 0);
   }
 
   return SelectorsLoaded[Index];
 }
 
-DeclarationName 
+DeclarationName
 PCHReader::ReadDeclarationName(const RecordData &Record, unsigned &Idx) {
   DeclarationName::NameKind Kind = (DeclarationName::NameKind)Record[Idx++];
   switch (Kind) {
@@ -2478,7 +2478,7 @@
 /// \brief Record that the given label statement has been
 /// deserialized and has the given ID.
 void PCHReader::RecordLabelStmt(LabelStmt *S, unsigned ID) {
-  assert(LabelStmts.find(ID) == LabelStmts.end() && 
+  assert(LabelStmts.find(ID) == LabelStmts.end() &&
          "Deserialized label twice");
   LabelStmts[ID] = S;
 
@@ -2493,9 +2493,9 @@
   // If we've already seen any address-label statements that point to
   // this label, resolve them now.
   typedef std::multimap<unsigned, AddrLabelExpr *>::iterator AddrLabelIter;
-  std::pair<AddrLabelIter, AddrLabelIter> AddrLabels 
+  std::pair<AddrLabelIter, AddrLabelIter> AddrLabels
     = UnresolvedAddrLabelExprs.equal_range(ID);
-  for (AddrLabelIter AddrLabel = AddrLabels.first; 
+  for (AddrLabelIter AddrLabel = AddrLabels.first;
        AddrLabel != AddrLabels.second; ++AddrLabel)
     AddrLabel->second->setLabel(S);
   UnresolvedAddrLabelExprs.erase(AddrLabels.first, AddrLabels.second);
@@ -2542,7 +2542,7 @@
 }
 
 
-PCHReader::LoadingTypeOrDecl::LoadingTypeOrDecl(PCHReader &Reader) 
+PCHReader::LoadingTypeOrDecl::LoadingTypeOrDecl(PCHReader &Reader)
   : Reader(Reader), Parent(Reader.CurrentlyLoadingTypeOrDecl) {
   Reader.CurrentlyLoadingTypeOrDecl = this;
 }
@@ -2559,5 +2559,5 @@
     }
   }
 
-  Reader.CurrentlyLoadingTypeOrDecl = Parent;  
+  Reader.CurrentlyLoadingTypeOrDecl = Parent;
 }