From: Chris Lattner Date: Tue, 23 Nov 2010 09:01:31 +0000 (+0000) Subject: don't allow remapping PTH file paths with -fworking-directory, the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=681c74afe6a81161aa13291c6c114e5240b23865;p=clang don't allow remapping PTH file paths with -fworking-directory, the client should just pass in absolute paths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120012 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Lex/PTHManager.h b/include/clang/Lex/PTHManager.h index 531ec11ea1..5e8a4f144c 100644 --- a/include/clang/Lex/PTHManager.h +++ b/include/clang/Lex/PTHManager.h @@ -119,8 +119,7 @@ public: /// Create - This method creates PTHManager objects. The 'file' argument /// is the name of the PTH file. This method returns NULL upon failure. - static PTHManager *Create(const std::string& file, FileManager &FileMgr, - Diagnostic &Diags); + static PTHManager *Create(const std::string& file, Diagnostic &Diags); void setPreprocessor(Preprocessor *pp) { PP = pp; } diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 125f271a62..7f3eb21bb8 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -180,7 +180,7 @@ CompilerInstance::createPreprocessor(Diagnostic &Diags, // Create a PTH manager if we are using some form of a token cache. PTHManager *PTHMgr = 0; if (!PPOpts.TokenCache.empty()) - PTHMgr = PTHManager::Create(PPOpts.TokenCache, FileMgr, Diags); + PTHMgr = PTHManager::Create(PPOpts.TokenCache, Diags); // Create the Preprocessor. HeaderSearch *HeaderInfo = new HeaderSearch(FileMgr); diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index 23ff3f4790..08de3a80f9 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -434,10 +434,9 @@ static void InvalidPTH(Diagnostic &Diags, const char *Msg) { Diags.Report(Diags.getCustomDiagID(Diagnostic::Error, Msg)); } -PTHManager *PTHManager::Create(const std::string &file, FileManager &FileMgr, - Diagnostic &Diags) { +PTHManager *PTHManager::Create(const std::string &file, Diagnostic &Diags) { // Memory map the PTH file. - llvm::OwningPtr File(FileMgr.getBufferForFile(file)); + llvm::OwningPtr File(llvm::MemoryBuffer::getFile(file)); if (!File) { Diags.Report(diag::err_invalid_pth_file) << file;