summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lli/lli.cpp3
-rw-r--r--llvm/tools/llvm-extract/llvm-extract.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 7923e8fe42d..605893e0ba2 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -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());
}
diff --git a/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp
index e576d0893bf..aa1eda2f094 100644
--- a/llvm/tools/llvm-extract/llvm-extract.cpp
+++ b/llvm/tools/llvm-extract/llvm-extract.cpp
@@ -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()); };
OpenPOWER on IntegriCloud