search for: functionthatneedstobereplac

Displaying 4 results from an estimated 4 matches for "functionthatneedstobereplac".

2009 Nov 05
2
[LLVMdev] create dummy function
Hello, I have a simple question. How to create "dummy" function which will have no functionality behind (return nothing and do nothing)? Currently I'm trying to do this: llvm::Constant* c = Module.getOrInsertFunction("dummy", FunctionThatNeedsToBeReplaced.getFunctionType()); llvm::Function* dummy = llvm::cast<llvm::Function>(c); This way I create new function that do nothing.Then next step is: FunctionThatNeedsToBeReplaced.replaceAllUsesWith(dummy); This code is doing what I want to do, but it ends up with exception: ERROR: Program used e...
2009 Nov 05
0
[LLVMdev] create dummy function
...gmail.com>: > Hello, > I have a simple question. How to create "dummy" function which will > have no functionality behind (return nothing and do nothing)? > Currently I'm trying to do this: > > llvm::Constant* c = Module.getOrInsertFunction("dummy", > FunctionThatNeedsToBeReplaced.getFunctionType()); > llvm::Function* dummy = llvm::cast<llvm::Function>(c); Hi Oleg, Every function needs a BasicBlock, even if the basic block just contains a return. The only reason to create a function without a basic block is when the function is extern'd and imported via JIT...
2009 Nov 05
3
[LLVMdev] create dummy function
...o, >> I have a simple question. How to create "dummy" function which will >> have no functionality behind (return nothing and do nothing)? >> Currently I'm trying to do this: >> >> llvm::Constant* c = Module.getOrInsertFunction("dummy", >> FunctionThatNeedsToBeReplaced.getFunctionType()); >> llvm::Function* dummy = llvm::cast<llvm::Function>(c); > > Hi Oleg, > > Every function needs a BasicBlock, even if the basic block just > contains a return. > > The only reason to create a function without a basic block is when the > func...
2009 Nov 15
0
[LLVMdev] create dummy function
...simple question. How to create "dummy" function which will >>> have no functionality behind (return nothing and do nothing)? >>> Currently I'm trying to do this: >>> >>> llvm::Constant* c = Module.getOrInsertFunction("dummy", >>> FunctionThatNeedsToBeReplaced.getFunctionType()); >>> llvm::Function* dummy = llvm::cast<llvm::Function>(c); >> >> Hi Oleg, >> >> Every function needs a BasicBlock, even if the basic block just >> contains a return. >> >> The only reason to create a function without a b...