diff options
author | Anders Carlsson <andersca@mac.com> | 2011-03-08 16:04:35 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-03-08 16:04:35 +0000 |
commit | 2c10c8072cabeb22651462e435e8b81f3221b6a5 (patch) | |
tree | b8e3ce2d528aa9325959ad4af483f050a1caee44 /lib/Serialization/ASTWriter.cpp | |
parent | acba90f30876b4140b738f0d3dd0e50724053a96 (diff) |
When writing file references in a pch, make sure to ask the file manager for the absolute path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index f172b7acec..1cb195dd31 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -1460,6 +1460,13 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr, // Turn the file name into an absolute path, if it isn't already. const char *Filename = Content->OrigEntry->getName(); llvm::SmallString<128> FilePath(Filename); + + // Ask the file manager to fixup the relative path for us. This will + // honor the working directory. + SourceMgr.getFileManager().FixupRelativePath(FilePath); + + // FIXME: This call to make_absolute shouldn't be necessary, the + // call to FixupRelativePath should always return an absolute path. llvm::sys::fs::make_absolute(FilePath); Filename = FilePath.c_str(); |