diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-10-30 00:38:13 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-10-30 00:38:13 +0000 |
commit | 848bc3a5db57fb267e2b2541cb55e71dba4bf228 (patch) | |
tree | 1f8577ca9c7f810189c84e38831619e24633556c /lib/Serialization/ASTReader.cpp | |
parent | 33e1576ef88ae6fcc4ed8686f34ed28b1a41bcce (diff) |
getOriginalSourceFileName and getOriginalSourceFile can return a StringRef.
MaybeAddSystemRootToFilename doesn't need to return anything, it modifies
its argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReader.cpp')
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 48578569d5..874d2c4b1b 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -1679,19 +1679,19 @@ const FileEntry *ASTReader::getFileEntry(StringRef filenameStrRef) { /// \brief If we are loading a relocatable PCH file, and the filename is /// not an absolute path, add the system root to the beginning of the file /// name. -StringRef ASTReader::MaybeAddSystemRootToFilename(ModuleFile &M, - std::string &Filename) { +void ASTReader::MaybeAddSystemRootToFilename(ModuleFile &M, + std::string &Filename) { // If this is not a relocatable PCH file, there's nothing to do. if (!M.RelocatablePCH) - return Filename; + return; if (Filename.empty() || llvm::sys::path::is_absolute(Filename)) - return Filename; + return; if (isysroot.empty()) { // If no system root was given, default to '/' Filename.insert(Filename.begin(), '/'); - return Filename; + return; } unsigned Length = isysroot.size(); @@ -1699,7 +1699,6 @@ StringRef ASTReader::MaybeAddSystemRootToFilename(ModuleFile &M, Filename.insert(Filename.begin(), '/'); Filename.insert(Filename.begin(), isysroot.begin(), isysroot.end()); - return Filename; } ASTReader::ASTReadResult |