#include "clang/Tooling/AllTUsExecution.h"
#include "clang/Tooling/ToolExecutorPluginRegistry.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/VirtualFileSystem.h"
namespace clang {
namespace tooling {
const char *AllTUsToolExecutor::ExecutorName = …;
namespace {
llvm::Error make_string_error(const llvm::Twine &Message) { … }
ArgumentsAdjuster getDefaultArgumentsAdjusters() { … }
class ThreadSafeToolResults : public ToolResults { … };
}
llvm::cl::opt<std::string>
Filter("filter",
llvm::cl::desc("Only process files that match this filter. "
"This flag only applies to all-TUs."),
llvm::cl::init(".*"));
AllTUsToolExecutor::AllTUsToolExecutor(
const CompilationDatabase &Compilations, unsigned ThreadCount,
std::shared_ptr<PCHContainerOperations> PCHContainerOps)
: … { … }
AllTUsToolExecutor::AllTUsToolExecutor(
CommonOptionsParser Options, unsigned ThreadCount,
std::shared_ptr<PCHContainerOperations> PCHContainerOps)
: … { … }
llvm::Error AllTUsToolExecutor::execute(
llvm::ArrayRef<
std::pair<std::unique_ptr<FrontendActionFactory>, ArgumentsAdjuster>>
Actions) { … }
llvm::cl::opt<unsigned> ExecutorConcurrency(
"execute-concurrency",
llvm::cl::desc("The number of threads used to process all files in "
"parallel. Set to 0 for hardware concurrency. "
"This flag only applies to all-TUs."),
llvm::cl::init(0));
class AllTUsToolExecutorPlugin : public ToolExecutorPlugin { … };
static ToolExecutorPluginRegistry::Add<AllTUsToolExecutorPlugin>
X("all-TUs", "Runs FrontendActions on all TUs in the compilation database. "
"Tool results are stored in memory.");
volatile int AllTUsToolExecutorAnchorSource = …;
}
}