In ExecutionEngine::getPointerToGlobal(), throw away const qualifier
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 13 Aug 2003 18:16:14 +0000 (18:16 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 13 Aug 2003 18:16:14 +0000 (18:16 +0000)
 on Function * when passing it to getPointerToFunction().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7818 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/ExecutionEngine.cpp

index 72d08f5fe161fe04e0d6e73b2afb0cd5703e6481..9b119c73e3547a2d1298c4eae0e3a25602212e90 100644 (file)
@@ -22,7 +22,7 @@ Statistic<> NumInitBytes("lli", "Number of bytes of global vars initialized");
 // value.  This may involve code generation if it's a function.
 //
 void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) {
-  if (const Function *F = dyn_cast<Function>(GV))
+  if (Function *F = const_cast<Function*>(dyn_cast<Function>(GV)))
     return getPointerToFunction(F);
 
   assert(GlobalAddress[GV] && "Global hasn't had an address allocated yet?");