diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-07-29 19:17:44 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-07-29 19:17:44 +0000 |
| commit | 125b9244cabf098f878b8affafbc7f26ab1080c9 (patch) | |
| tree | 118fa038829659ff472f78b8231065d87ad71e81 | |
| parent | 658f8e6c7e2df24d2358cb1bcafc2f2849facdce (diff) | |
| download | bcm5719-llvm-125b9244cabf098f878b8affafbc7f26ab1080c9.tar.gz bcm5719-llvm-125b9244cabf098f878b8affafbc7f26ab1080c9.zip | |
Small gold plugin simplifications.
* Use a range loop.
* Store the extra options as "const char *".
llvm-svn: 214199
| -rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index b90851019fe..8c30ba2a428 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -89,7 +89,7 @@ namespace options { // as plugin exclusive to pass to the code generator. // For example, "generate-api-file" and "as"options are for the plugin // use only and will not be passed. - static std::vector<std::string> extra; + static std::vector<const char *> extra; static void process_plugin_option(const char* opt_) { @@ -122,7 +122,7 @@ namespace options { } } else { // Save this option to pass to the code generator. - extra.push_back(opt); + extra.push_back(opt_); } } } @@ -237,10 +237,8 @@ ld_plugin_status onload(ld_plugin_tv *tv) { // Pass through extra options to the code generator. if (!options::extra.empty()) { - for (std::vector<std::string>::iterator it = options::extra.begin(); - it != options::extra.end(); ++it) { - CodeGen->setCodeGenDebugOptions((*it).c_str()); - } + for (const char *Opt : options::extra) + CodeGen->setCodeGenDebugOptions(Opt); } CodeGen->parseCodeGenDebugOptions(); |

