[llvm-commits] [llvm] r78245 - in /llvm/trunk/tools: bugpoint/ToolRunner.cpp llvm-ld/llvm-ld.cpp

Dan Gohman gohman at apple.com
Wed Aug 5 14:03:52 PDT 2009


Author: djg
Date: Wed Aug  5 16:03:39 2009
New Revision: 78245

URL: http://llvm.org/viewvc/llvm-project?rev=78245&view=rev
Log:
Use (void *)(intptr_t) to cast function addresses to void*
for use with sys::Path::GetMainExecutable, to avoid warnings
with -pedantic.

Modified:
    llvm/trunk/tools/bugpoint/ToolRunner.cpp
    llvm/trunk/tools/llvm-ld/llvm-ld.cpp

Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=78245&r1=78244&r2=78245&view=diff

==============================================================================
--- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original)
+++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Wed Aug  5 16:03:39 2009
@@ -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";

Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/llvm-ld.cpp?rev=78245&r1=78244&r2=78245&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original)
+++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Wed Aug  5 16:03:39 2009
@@ -415,7 +415,7 @@
   // build tree to the destination file.
   std::string ErrMsg;  
   sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0],
-                                      reinterpret_cast<void *>(&Optimize));
+                                      (void *)(intptr_t)&Optimize);
   if (llvmstub.isEmpty())
     PrintAndExit("Could not find llvm-stub.exe executable!");
 
@@ -642,7 +642,7 @@
 
         // Determine the locations of the llc and gcc programs.
         sys::Path llc = FindExecutable("llc", argv[0],
-                                       reinterpret_cast<void *>(&Optimize));
+                                       (void *)(intptr_t)&Optimize);
         if (llc.isEmpty())
           PrintAndExit("Failed to find llc");
 
@@ -672,7 +672,7 @@
 
         // Determine the locations of the llc and gcc programs.
         sys::Path llc = FindExecutable("llc", argv[0],
-                                       reinterpret_cast<void *>(&Optimize));
+                                       (void *)(intptr_t)&Optimize);
         if (llc.isEmpty())
           PrintAndExit("Failed to find llc");
 





More information about the llvm-commits mailing list