[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Intercept.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Jun 1 10:12:36 PDT 2006



Changes in directory llvm/lib/ExecutionEngine/JIT:

Intercept.cpp updated: 1.25 -> 1.26
---
Log message:

Silence some -pedantic warnings.


---
Diffs of the changes:  (+6 -4)

 Intercept.cpp |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


Index: llvm/lib/ExecutionEngine/JIT/Intercept.cpp
diff -u llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.25 llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.26
--- llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.25	Mon Mar 13 23:54:51 2006
+++ llvm/lib/ExecutionEngine/JIT/Intercept.cpp	Thu Jun  1 12:12:14 2006
@@ -90,13 +90,15 @@
 /// for resolving library symbols, not code generated symbols.
 ///
 void *JIT::getPointerToNamedFunction(const std::string &Name) {
-  // Check to see if this is one of the functions we want to intercept...
-  if (Name == "exit") return (void*)&jit_exit;
-  if (Name == "atexit") return (void*)&jit_atexit;
+  // Check to see if this is one of the functions we want to intercept.  Note,
+  // we cast to intptr_t here to silence a -pedantic warning that complains
+  // about casting a function pointer to a normal pointer.
+  if (Name == "exit") return (void*)(intptr_t)&jit_exit;
+  if (Name == "atexit") return (void*)(intptr_t)&jit_atexit;
 
   // If the program does not have a linked in __main function, allow it to run,
   // but print a warning.
-  if (Name == "__main") return (void*)&__mainFunc;
+  if (Name == "__main") return (void*)(intptr_t)&__mainFunc;
 
   // If it's an external function, look it up in the process image...
   void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(Name);






More information about the llvm-commits mailing list