1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00

[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

llvm-svn: 286396
This commit is contained in:
Davide Italiano 2016-11-09 21:30:33 +00:00
parent f7fdda3373
commit cc1d7bf278
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()); };