aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-23 09:01:31 +0000
committerChris Lattner <sabre@nondot.org>2010-11-23 09:01:31 +0000
commit681c74afe6a81161aa13291c6c114e5240b23865 (patch)
tree5754ec1abaee9d0db92461949f43acb2aa8e36e9
parentb088cd3138b1fdb286c51e982ddda1e8af9d7e86 (diff)
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
-rw-r--r--include/clang/Lex/PTHManager.h3
-rw-r--r--lib/Frontend/CompilerInstance.cpp2
-rw-r--r--lib/Lex/PTHLexer.cpp5
3 files changed, 4 insertions, 6 deletions
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<llvm::MemoryBuffer> File(FileMgr.getBufferForFile(file));
+ llvm::OwningPtr<llvm::MemoryBuffer> File(llvm::MemoryBuffer::getFile(file));
if (!File) {
Diags.Report(diag::err_invalid_pth_file) << file;