summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-03-08 16:04:35 +0000
committerAnders Carlsson <andersca@mac.com>2011-03-08 16:04:35 +0000
commita426705cc6c70064d059036f1db0c92715d51cee (patch)
treeca684ef93340fe89ccd574e366b94004145031df /clang/lib/Serialization/ASTWriter.cpp
parent679cfb54ecca9f631f1183cce1b9aa1f6fdb41af (diff)
downloadbcm5719-llvm-a426705cc6c70064d059036f1db0c92715d51cee.tar.gz
bcm5719-llvm-a426705cc6c70064d059036f1db0c92715d51cee.zip
When writing file references in a pch, make sure to ask the file manager for the absolute path.
llvm-svn: 127248
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index f172b7aceca..1cb195dd310 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud