const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; }
- const std::string &getOriginalSourceFileName() {
+ const StringRef getOriginalSourceFileName() {
return OriginalSourceFile;
}
/// into account all the necessary relocations.
const FileEntry *getFileEntry(StringRef filename);
- StringRef MaybeAddSystemRootToFilename(ModuleFile &M, std::string &Filename);
+ void MaybeAddSystemRootToFilename(ModuleFile &M, std::string &Filename);
ASTReadResult ReadASTCore(StringRef FileName, ModuleKind Type,
ModuleFile *ImportedBy,
/// \brief Retrieve the name of the original source file name for the primary
/// module file.
- const std::string &getOriginalSourceFile() {
+ StringRef getOriginalSourceFile() {
return ModuleMgr.getPrimaryModule().OriginalSourceFileName;
}
/// \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();
Filename.insert(Filename.begin(), '/');
Filename.insert(Filename.begin(), isysroot.begin(), isysroot.end());
- return Filename;
}
ASTReader::ASTReadResult