summaryrefslogtreecommitdiff
path: root/clang/examples
diff options
context:
space:
mode:
authorTimm Bäder <tbaeder@redhat.com>2021-11-04 17:40:51 +0100
committerTimm Bäder <tbaeder@redhat.com>2021-11-25 10:47:55 +0100
commit3e67cf21a19a0e8917bdbab6f0cecd4880f3fbe2 (patch)
tree2797e14e833b64306c240f4301ec364a295021ef /clang/examples
parent8dae0b6b6c9a0256908820b9ef4bc04f0119666b (diff)
downloadllvm-3e67cf21a19a0e8917bdbab6f0cecd4880f3fbe2.tar.gz
[clang][driver] Add -fplugin-arg- to pass arguments to plugins
From GCC's manpage: -fplugin-arg-name-key=value Define an argument called key with a value of value for the plugin called name. Since we don't have a key-value pair similar to gcc's plugin_argument struct, simply accept key=value here anyway and pass it along as-is to plugins. This translates to the already existing '-plugin-arg-pluginname arg' that clang cc1 accepts. There is an ambiguity here because in clang, both the plugin name as well as the option name can contain dashes, so when e.g. passing -fplugin-arg-foo-bar-foo it is not clear whether the plugin is foo-bar and the option is foo, or the plugin is foo and the option is bar-foo. GCC solves this by interpreting all dashes as part of the option name. So dashes can't be part of the plugin name in this case. Differential Revision: https://reviews.llvm.org/D113250
Diffstat (limited to 'clang/examples')
-rw-r--r--clang/examples/CallSuperAttribute/CallSuperAttrInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/examples/CallSuperAttribute/CallSuperAttrInfo.cpp b/clang/examples/CallSuperAttribute/CallSuperAttrInfo.cpp
index 331f63508045..21460e4f6bd0 100644
--- a/clang/examples/CallSuperAttribute/CallSuperAttrInfo.cpp
+++ b/clang/examples/CallSuperAttribute/CallSuperAttrInfo.cpp
@@ -145,6 +145,8 @@ public:
bool ParseArgs(const CompilerInstance &CI,
const std::vector<std::string> &args) override {
+ if (!args.empty() && args[0] == "help")
+ llvm::errs() << "Help for the CallSuperAttr plugin goes here\n";
return true;
}