]> granicus.if.org Git - clang/commitdiff
Add back warning about a PTH file not containing any identifiers, but don't make
authorTed Kremenek <kremenek@apple.com>
Sat, 21 Mar 2009 00:25:09 +0000 (00:25 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 21 Mar 2009 00:25:09 +0000 (00:25 +0000)
it a hard error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67424 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PTHLexer.cpp

index b5f5afd81ab17db9c79ee6caf526f8e30a039baa..e547ce551b92e7810791966faeda752f71fd7500 100644 (file)
@@ -675,6 +675,12 @@ PTHManager* PTHManager::Create(const std::string& file, Diagnostic* Diags) {
 
   llvm::OwningPtr<PTHStringIdLookup> SL(PTHStringIdLookup::Create(StringIdTable,
                                                                   BufBeg));
+  
+  // Issue a warning about the PTH file containing no identifiers.                                                                
+  if (!FL->isEmpty() && SL->isEmpty()) {
+    InvalidPTH(Diags, "PTH file contains no identifiers.");
+  }
+
   // Get the location of the spelling cache.
   const unsigned char* spellingBaseOffset = PrologueOffset + sizeof(uint32_t)*3;
   const unsigned char* spellingBase = BufBeg + ReadLE32(spellingBaseOffset);