summaryrefslogtreecommitdiffstats
path: root/lib/Tooling/CommonOptionsParser.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
committerdim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
commit3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch)
treedbbd4047878da71c1a706e26ce05b4e7791b14cc /lib/Tooling/CommonOptionsParser.cpp
parent38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff)
downloadFreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip
FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'lib/Tooling/CommonOptionsParser.cpp')
-rw-r--r--lib/Tooling/CommonOptionsParser.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Tooling/CommonOptionsParser.cpp b/lib/Tooling/CommonOptionsParser.cpp
index 91c74a4..adae178 100644
--- a/lib/Tooling/CommonOptionsParser.cpp
+++ b/lib/Tooling/CommonOptionsParser.cpp
@@ -54,6 +54,7 @@ const char *const CommonOptionsParser::HelpMessage =
"\tsuffix of a path in the compile command database.\n"
"\n";
+namespace {
class ArgumentsAdjustingCompilations : public CompilationDatabase {
public:
ArgumentsAdjustingCompilations(
@@ -89,6 +90,7 @@ private:
return Commands;
}
};
+} // namespace
CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv,
cl::OptionCategory &Category,
@@ -112,15 +114,7 @@ CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv,
cl::desc("Additional argument to prepend to the compiler command line"),
cl::cat(Category));
- // Hide unrelated options.
- StringMap<cl::Option*> Options;
- cl::getRegisteredOptions(Options);
- for (StringMap<cl::Option *>::iterator I = Options.begin(), E = Options.end();
- I != E; ++I) {
- if (I->second->Category != &Category && I->first() != "help" &&
- I->first() != "version")
- I->second->setHiddenFlag(cl::ReallyHidden);
- }
+ cl::HideUnrelatedOptions(Category);
Compilations.reset(FixedCompilationDatabase::loadFromCommandLine(argc,
argv));
OpenPOWER on IntegriCloud