Use (void *)(intptr_t) to cast function addresses to void*
for use with sys::Path::GetMainExecutable, to avoid warnings
with -pedantic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78245 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index bce4d52..c9efbb8 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -232,8 +232,7 @@
std::string &Message,
const std::vector<std::string> *ToolArgs) {
std::string LLIPath =
- FindExecutable("lli", Argv0,
- reinterpret_cast<void *>(&createLLI)).toString();
+ FindExecutable("lli", Argv0, (void *)(intptr_t)&createLLI).toString();
if (!LLIPath.empty()) {
Message = "Found lli: " + LLIPath + "\n";
return new LLI(LLIPath, ToolArgs);
@@ -420,8 +419,7 @@
const std::vector<std::string> *Args,
const std::vector<std::string> *GCCArgs) {
std::string LLCPath =
- FindExecutable("llc", Argv0,
- reinterpret_cast<void *>(&createLLC)).toString();
+ FindExecutable("llc", Argv0, (void *)(intptr_t)&createLLC).toString();
if (LLCPath.empty()) {
Message = "Cannot find `llc' in executable directory or PATH!\n";
return 0;
@@ -507,8 +505,7 @@
AbstractInterpreter *AbstractInterpreter::createJIT(const char *Argv0,
std::string &Message, const std::vector<std::string> *Args) {
std::string LLIPath =
- FindExecutable("lli", Argv0,
- reinterpret_cast<void *>(&createJIT)).toString();
+ FindExecutable("lli", Argv0, (void *)(intptr_t)&createJIT).toString();
if (!LLIPath.empty()) {
Message = "Found lli: " + LLIPath + "\n";
return new JIT(LLIPath, Args);
@@ -587,8 +584,7 @@
const std::vector<std::string> *Args,
const std::vector<std::string> *GCCArgs) {
sys::Path LLCPath =
- FindExecutable("llc", Argv0,
- reinterpret_cast<void *>(&createCBE));
+ FindExecutable("llc", Argv0, (void *)(intptr_t)&createCBE);
if (LLCPath.isEmpty()) {
Message =
"Cannot find `llc' in executable directory or PATH!\n";