forked from OSchip/llvm-project
Add "-token-cache" option for using pretokenized cache files.
llvm-svn: 60440
This commit is contained in:
parent
9b0b28e021
commit
da4d9dfbca
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue