r317328 - [Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 3 08:20:57 PDT 2017
Author: ioeric
Date: Fri Nov 3 08:20:57 2017
New Revision: 317328
URL: http://llvm.org/viewvc/llvm-project?rev=317328&view=rev
Log:
[Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC
Modified:
cfe/trunk/include/clang/Tooling/Execution.h
cfe/trunk/lib/Tooling/Execution.cpp
Modified: cfe/trunk/include/clang/Tooling/Execution.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Execution.h?rev=317328&r1=317327&r2=317328&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/Execution.h (original)
+++ cfe/trunk/include/clang/Tooling/Execution.h Fri Nov 3 08:20:57 2017
@@ -162,6 +162,13 @@ createExecutorFromCommandLineArgs(int &a
llvm::cl::OptionCategory &Category,
const char *Overview = nullptr);
+namespace internal {
+llvm::Expected<std::unique_ptr<ToolExecutor>>
+createExecutorFromCommandLineArgsImpl(int &argc, const char **argv,
+ llvm::cl::OptionCategory &Category,
+ const char *Overview = nullptr);
+} // end namespace internal
+
} // end namespace tooling
} // end namespace clang
Modified: cfe/trunk/lib/Tooling/Execution.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Execution.cpp?rev=317328&r1=317327&r2=317328&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Execution.cpp (original)
+++ cfe/trunk/lib/Tooling/Execution.cpp Fri Nov 3 08:20:57 2017
@@ -54,10 +54,11 @@ llvm::Error ToolExecutor::execute(std::u
return execute(Actions);
}
+namespace internal {
llvm::Expected<std::unique_ptr<ToolExecutor>>
-createExecutorFromCommandLineArgs(int &argc, const char **argv,
- llvm::cl::OptionCategory &Category,
- const char *Overview) {
+createExecutorFromCommandLineArgsImpl(int &argc, const char **argv,
+ llvm::cl::OptionCategory &Category,
+ const char *Overview) {
auto OptionsParser =
CommonOptionsParser::create(argc, argv, Category, llvm::cl::ZeroOrMore,
/*Overview=*/nullptr);
@@ -84,6 +85,15 @@ createExecutorFromCommandLineArgs(int &a
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);
+}
} // end namespace tooling
} // end namespace clang
More information about the cfe-commits
mailing list