diff options
author | Jan Korous <jkorous@apple.com> | 2019-11-08 10:40:27 -0800 |
---|---|---|
committer | Jan Korous <jkorous@apple.com> | 2019-11-08 10:58:50 -0800 |
commit | 590f279c456bbde632eca8ef89a85c478f15a249 (patch) | |
tree | 6005e7dc6a41b6310f3622d90b2d1eadb3e4b982 /llvm | |
parent | 3ffbf9720fb01d156f09b0eabdeafc548711fb19 (diff) | |
download | bcm5719-llvm-590f279c456bbde632eca8ef89a85c478f15a249.tar.gz bcm5719-llvm-590f279c456bbde632eca8ef89a85c478f15a249.zip |
[clang] Add VFS support for sanitizers' blacklists
Differential Revision: https://reviews.llvm.org/D69648
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Support/SpecialCaseList.h | 5 | ||||
-rw-r--r-- | llvm/lib/Support/SpecialCaseList.cpp | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h index b7400266f4d..74a7a45312a 100644 --- a/llvm/include/llvm/Support/SpecialCaseList.h +++ b/llvm/include/llvm/Support/SpecialCaseList.h @@ -55,6 +55,7 @@ #include "llvm/ADT/StringSet.h" #include "llvm/Support/Regex.h" #include "llvm/Support/TrigramIndex.h" +#include "llvm/Support/VirtualFileSystem.h" #include <string> #include <vector> @@ -102,8 +103,8 @@ public: protected: // Implementations of the create*() functions that can also be used by derived // classes. - bool createInternal(const std::vector<std::string> &Paths, - std::string &Error); + bool createInternal(const std::vector<std::string> &Paths, std::string &Error, + vfs::FileSystem &VFS = *vfs::getRealFileSystem()); bool createInternal(const MemoryBuffer *MB, std::string &Error); SpecialCaseList() = default; diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp index 9bd1f18a4ee..5812f075aa4 100644 --- a/llvm/lib/Support/SpecialCaseList.cpp +++ b/llvm/lib/Support/SpecialCaseList.cpp @@ -95,11 +95,11 @@ SpecialCaseList::createOrDie(const std::vector<std::string> &Paths) { } bool SpecialCaseList::createInternal(const std::vector<std::string> &Paths, - std::string &Error) { + std::string &Error, vfs::FileSystem &VFS) { StringMap<size_t> Sections; for (const auto &Path : Paths) { ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr = - MemoryBuffer::getFile(Path); + VFS.getBufferForFile(Path); if (std::error_code EC = FileOrErr.getError()) { Error = (Twine("can't open file '") + Path + "': " + EC.message()).str(); return false; |