summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/clang/lib/Tooling/Execution.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 15:06:44 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 15:06:44 +0000
commitb64793999546ed8adebaeebd9d8345d18db8927d (patch)
tree4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/tools/clang/lib/Tooling/Execution.cpp
parentAdd support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff)
downloadwireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz
wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Tooling/Execution.cpp')
-rw-r--r--gnu/llvm/tools/clang/lib/Tooling/Execution.cpp108
1 files changed, 0 insertions, 108 deletions
diff --git a/gnu/llvm/tools/clang/lib/Tooling/Execution.cpp b/gnu/llvm/tools/clang/lib/Tooling/Execution.cpp
deleted file mode 100644
index 9ddb18a57b4..00000000000
--- a/gnu/llvm/tools/clang/lib/Tooling/Execution.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//===- lib/Tooling/Execution.cpp - Implements tool execution framework. ---===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Tooling/Execution.h"
-#include "clang/Tooling/ToolExecutorPluginRegistry.h"
-#include "clang/Tooling/Tooling.h"
-
-LLVM_INSTANTIATE_REGISTRY(clang::tooling::ToolExecutorPluginRegistry)
-
-namespace clang {
-namespace tooling {
-
-llvm::cl::opt<std::string>
- ExecutorName("executor", llvm::cl::desc("The name of the executor to use."),
- llvm::cl::init("standalone"));
-
-void InMemoryToolResults::addResult(StringRef Key, StringRef Value) {
- KVResults.push_back({Strings.save(Key), Strings.save(Value)});
-}
-
-std::vector<std::pair<llvm::StringRef, llvm::StringRef>>
-InMemoryToolResults::AllKVResults() {
- return KVResults;
-}
-
-void InMemoryToolResults::forEachResult(
- llvm::function_ref<void(StringRef Key, StringRef Value)> Callback) {
- for (const auto &KV : KVResults) {
- Callback(KV.first, KV.second);
- }
-}
-
-void ExecutionContext::reportResult(StringRef Key, StringRef Value) {
- Results->addResult(Key, Value);
-}
-
-llvm::Error
-ToolExecutor::execute(std::unique_ptr<FrontendActionFactory> Action) {
- return execute(std::move(Action), ArgumentsAdjuster());
-}
-
-llvm::Error ToolExecutor::execute(std::unique_ptr<FrontendActionFactory> Action,
- ArgumentsAdjuster Adjuster) {
- std::vector<
- std::pair<std::unique_ptr<FrontendActionFactory>, ArgumentsAdjuster>>
- Actions;
- Actions.emplace_back(std::move(Action), std::move(Adjuster));
- return execute(Actions);
-}
-
-namespace internal {
-llvm::Expected<std::unique_ptr<ToolExecutor>>
-createExecutorFromCommandLineArgsImpl(int &argc, const char **argv,
- llvm::cl::OptionCategory &Category,
- const char *Overview) {
- auto OptionsParser =
- CommonOptionsParser::create(argc, argv, Category, llvm::cl::ZeroOrMore,
- /*Overview=*/Overview);
- if (!OptionsParser)
- return OptionsParser.takeError();
- for (auto I = ToolExecutorPluginRegistry::begin(),
- E = ToolExecutorPluginRegistry::end();
- I != E; ++I) {
- if (I->getName() != ExecutorName) {
- continue;
- }
- std::unique_ptr<ToolExecutorPlugin> Plugin(I->instantiate());
- llvm::Expected<std::unique_ptr<ToolExecutor>> Executor =
- Plugin->create(*OptionsParser);
- if (!Executor) {
- return llvm::make_error<llvm::StringError>(
- llvm::Twine("Failed to create '") + I->getName() +
- "': " + llvm::toString(Executor.takeError()) + "\n",
- llvm::inconvertibleErrorCode());
- }
- return std::move(*Executor);
- }
- return llvm::make_error<llvm::StringError>(
- llvm::Twine("Executor \"") + ExecutorName + "\" is not registered.",
- llvm::inconvertibleErrorCode());
-}
-} // end namespace internal
-
-llvm::Expected<std::unique_ptr<ToolExecutor>>
-createExecutorFromCommandLineArgs(int &argc, const char **argv,
- llvm::cl::OptionCategory &Category,
- const char *Overview) {
- return internal::createExecutorFromCommandLineArgsImpl(argc, argv, Category,
- Overview);
-}
-
-// This anchor is used to force the linker to link in the generated object file
-// and thus register the StandaloneToolExecutorPlugin etc.
-extern volatile int StandaloneToolExecutorAnchorSource;
-extern volatile int AllTUsToolExecutorAnchorSource;
-static int LLVM_ATTRIBUTE_UNUSED StandaloneToolExecutorAnchorDest =
- StandaloneToolExecutorAnchorSource;
-static int LLVM_ATTRIBUTE_UNUSED AllTUsToolExecutorAnchorDest =
- AllTUsToolExecutorAnchorSource;
-
-} // end namespace tooling
-} // end namespace clang