Implement -working-directory.
commit6dbcbbcfcdcc44c8f7641dc788d2523cf1a09b5b
authorArgiris Kirtzidis <akyrtzi@gmail.com>
Wed, 3 Nov 2010 22:45:23 +0000 (3 22:45 +0000)
committerArgiris Kirtzidis <akyrtzi@gmail.com>
Wed, 3 Nov 2010 22:45:23 +0000 (3 22:45 +0000)
treefee8c776b8591a09c1387bcc7dd3bd1bccb14e7e
parent1ecda74bf22dbfbdf7c7c62b9b13c9011464d11a
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
38 files changed:
include/clang/AST/ASTImporter.h
include/clang/Basic/FileManager.h
include/clang/Basic/FileSystemOptions.h [new file with mode: 0644]
include/clang/Basic/SourceManager.h
include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
include/clang/Frontend/ASTUnit.h
include/clang/Frontend/CompilerInstance.h
include/clang/Frontend/CompilerInvocation.h
include/clang/Frontend/Utils.h
include/clang/Lex/HeaderMap.h
include/clang/Lex/HeaderSearch.h
include/clang/Lex/PTHManager.h
include/clang/Lex/Preprocessor.h
include/clang/Serialization/ASTReader.h
lib/AST/ASTImporter.cpp
lib/Basic/FileManager.cpp
lib/Basic/SourceManager.cpp
lib/Driver/Driver.cpp
lib/Driver/Tools.cpp
lib/Frontend/ASTMerge.cpp
lib/Frontend/ASTUnit.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/FrontendAction.cpp
lib/Frontend/FrontendActions.cpp
lib/Frontend/InitHeaderSearch.cpp
lib/Frontend/InitPreprocessor.cpp
lib/Lex/HeaderMap.cpp
lib/Lex/HeaderSearch.cpp
lib/Lex/PTHLexer.cpp
lib/Lex/Preprocessor.cpp
lib/Serialization/ASTReader.cpp
test/Misc/Inputs/working-directory.h [new file with mode: 0644]
test/Misc/working-directory.c [new file with mode: 0644]
tools/libclang/CIndex.cpp
tools/libclang/CIndexCodeCompletion.cpp
tools/libclang/CIndexer.h