versioner: use a virtual filesystem for input files.
Use an InMemoryFileSystem to store and share input files across
compilations.
This improves the result of `time versioner` further, from:
versioner 109.12s user 17.43s system 2433% cpu 5.201 total
to:
versioner 112.20s user 1.38s system 2416% cpu 4.700 total
Bug: http://b/32748936
Test: python run_tests.py
Change-Id: I72d37b7c30850b8399cc40338247700fe3e7b2f9
diff --git a/tools/versioner/src/Driver.h b/tools/versioner/src/Driver.h
index c1a4b24..48683e4 100644
--- a/tools/versioner/src/Driver.h
+++ b/tools/versioner/src/Driver.h
@@ -20,16 +20,21 @@
#include <string>
#include <unordered_map>
+#include <llvm/ADT/IntrusiveRefCntPtr.h>
+
#include "Arch.h"
#include "DeclarationDatabase.h"
+#include "VFS.h"
struct CompilationRequirements {
std::vector<std::string> headers;
std::vector<std::string> dependencies;
};
-void initializeTargetCC1FlagCache(const std::set<CompilationType>& types,
+void initializeTargetCC1FlagCache(llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> vfs,
+ const std::set<CompilationType>& types,
const std::unordered_map<Arch, CompilationRequirements>& reqs);
-void compileHeader(HeaderDatabase* header_database, CompilationType type,
+void compileHeader(llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> vfs,
+ HeaderDatabase* header_database, CompilationType type,
const std::string& filename);