From 389db16c63eec6ecfa9b235155252d8da766e94e Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 3 Nov 2010 22:45:23 +0000 Subject: Implement -working-directory. When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118203 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Frontend/CompilerInvocation.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/clang/Frontend/CompilerInvocation.h') diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index aef02448f0..641c5f6650 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -12,6 +12,7 @@ #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetOptions.h" +#include "clang/Basic/FileSystemOptions.h" #include "clang/Frontend/AnalyzerOptions.h" #include "clang/Frontend/CodeGenOptions.h" #include "clang/Frontend/DependencyOutputOptions.h" @@ -52,6 +53,9 @@ class CompilerInvocation { /// Options controlling the diagnostic engine. DiagnosticOptions DiagnosticOpts; + /// Options controlling file system operations. + FileSystemOptions FileSystemOpts; + /// Options controlling the frontend itself. FrontendOptions FrontendOpts; @@ -126,6 +130,11 @@ public: DiagnosticOptions &getDiagnosticOpts() { return DiagnosticOpts; } const DiagnosticOptions &getDiagnosticOpts() const { return DiagnosticOpts; } + FileSystemOptions &getFileSystemOpts() { return FileSystemOpts; } + const FileSystemOptions &getFileSystemOpts() const { + return FileSystemOpts; + } + HeaderSearchOptions &getHeaderSearchOpts() { return HeaderSearchOpts; } const HeaderSearchOptions &getHeaderSearchOpts() const { return HeaderSearchOpts; -- cgit v1.2.3-18-g5258