diff options
| author | Jan Svoboda <jan_svoboda@apple.com> | 2025-10-24 11:05:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-24 11:05:22 -0700 |
| commit | 6de1c25d6ba2a22167160ff80f4875b312e79dcd (patch) | |
| tree | b929c5c29e1cab93b0e963a34b106ed40ffca312 /clang/lib/Basic/FileManager.cpp | |
| parent | 224f18e549c42233e1cc597873803a183927dfb3 (diff) | |
| download | llvm-6de1c25d6ba2a22167160ff80f4875b312e79dcd.zip llvm-6de1c25d6ba2a22167160ff80f4875b312e79dcd.tar.gz llvm-6de1c25d6ba2a22167160ff80f4875b312e79dcd.tar.bz2 | |
[clang] Don't require `FileManager` for creating an output file (#164665)
Conceptually, the `CompilerInstance` doesn't need an instance of the
`FileManager` to create an output file. This PR enables that, removing
an edge-case in `cc1_main()`.
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
| -rw-r--r-- | clang/lib/Basic/FileManager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index 7481e1e..e744cc0 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -474,8 +474,9 @@ OptionalFileEntryRef FileManager::getBypassFile(FileEntryRef VF) { return FileEntryRef(*Insertion.first); } -bool FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const { - StringRef pathRef(path.data(), path.size()); +bool FileManager::fixupRelativePath(const FileSystemOptions &FileSystemOpts, + SmallVectorImpl<char> &Path) { + StringRef pathRef(Path.data(), Path.size()); if (FileSystemOpts.WorkingDir.empty() || llvm::sys::path::is_absolute(pathRef)) @@ -483,7 +484,7 @@ bool FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const { SmallString<128> NewPath(FileSystemOpts.WorkingDir); llvm::sys::path::append(NewPath, pathRef); - path = NewPath; + Path = NewPath; return true; } |
