Add "-token-cache" option for using pretokenized cache files.

llvm-svn: 60440
This commit is contained in:
Ted Kremenek 2008-12-02 19:57:31 +00:00
parent 9b0b28e021
commit da4d9dfbca
1 changed files with 15 additions and 0 deletions

View File

@ -155,6 +155,15 @@ static llvm::cl::opt<bool>
GenerateDebugInfo("g",
llvm::cl::desc("Generate source level debug information"));
//===----------------------------------------------------------------------===//
// PTH.
//===----------------------------------------------------------------------===//
static llvm::cl::opt<std::string>
TokenCache("token-cache", llvm::cl::value_desc("path"),
llvm::cl::desc("Use specified token cache file"));
//===----------------------------------------------------------------------===//
// Diagnostic Options
//===----------------------------------------------------------------------===//
@ -904,6 +913,12 @@ static bool InitializePreprocessor(Preprocessor &PP,
PredefineBuffer.push_back(0);
PP.setPredefines(&PredefineBuffer[0]);
// Use PTH.
if (!TokenCache.empty()) {
PTHManager* PM = PTHManager::Create(TokenCache, PP);
if (PM) PP.setPTHManager(PM);
}
// Once we've read this, we're done.
return false;
}