[tools] Unbreak the GCC build (workaround a GCC bug).

../tools/llvm-extract/llvm-extract.cpp: In function ‘int main(int, char**)’:
warning: ISO C++ forbids zero-size array ‘argv’ [-Wpedantic]

GCC reference bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61259

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano 2016-11-09 21:30:33 +00:00
parent d964c86571
commit 003472894d
2 changed files with 4 additions and 2 deletions

View File

@ -418,7 +418,8 @@ int main(int argc, char **argv, char * const *envp) {
// If not jitting lazily, load the whole bitcode file eagerly too.
if (NoLazyCompilation) {
ExitOnError ExitOnErr(std::string(argv[0]) +
// Use *argv instead of argv[0] to work around a wrong GCC warning.
ExitOnError ExitOnErr(std::string(*argv) +
": bitcode didn't read correctly: ");
ExitOnErr(Mod->materializeAll());
}

View File

@ -223,7 +223,8 @@ int main(int argc, char **argv) {
}
}
ExitOnError ExitOnErr(std::string(argv[0]) + ": error reading input: ");
// Use *argv instead of argv[0] to work around a wrong GCC warning.
ExitOnError ExitOnErr(std::string(*argv) + ": error reading input: ");
auto Materialize = [&](GlobalValue &GV) { ExitOnErr(GV.materialize()); };