]> granicus.if.org Git - clang/commitdiff
don't allow remapping PTH file paths with -fworking-directory, the
authorChris Lattner <sabre@nondot.org>
Tue, 23 Nov 2010 09:01:31 +0000 (09:01 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 23 Nov 2010 09:01:31 +0000 (09:01 +0000)
client should just pass in absolute paths.

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

include/clang/Lex/PTHManager.h
lib/Frontend/CompilerInstance.cpp
lib/Lex/PTHLexer.cpp

index 531ec11ea1a7911c12cce17f236efeeebefa0920..5e8a4f144c96d0310aaccc06769e42bfa81efdbc 100644 (file)
@@ -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; }
 
index 125f271a62f09902134af778bc684cfedc04d037..7f3eb21bb8c46a22adde64f555b186cefc14a313 100644 (file)
@@ -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);
index 23ff3f479078621f1d408331be4c75f4a17bea9c..08de3a80f95acdd29bc532bd2f1633f6f846300a 100644 (file)
@@ -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;