Displaying 5 results from an estimated 5 matches for "newfntype".
2011 Feb 28
3
[LLVMdev] Extending FunctionType
...t think a full clone is necessary, since he wants to replace the
function. He only needs to create the new function and splice in the
body of the old one.
Gabriel: look at Function::getBasicBlockList() and
iplist<>::splice(iterator, iplist). Something like
Function *NewF = Function::Create(NewFnType, OldF->getLinkage());
NewF->getBasicBlockList().splice(NewF->begin(), OldF->getBasicBlockList());
NewF->takeName(OldF);
OldF->eraseFromParent();
is probably what you're looking for.
(Note: completely untested)
2011 Feb 28
2
[LLVMdev] Extending FunctionType
...placeAllUsesWith() on each old argument,
since there's no need to worry about preserving the integrity of the
old function.
>> Gabriel: look at Function::getBasicBlockList() and
>> iplist<>::splice(iterator, iplist). Something like
>> Function *NewF = Function::Create(NewFnType, OldF->getLinkage());
>> NewF->getBasicBlockList().splice(NewF->begin(),
>> OldF->getBasicBlockList());
>> NewF->takeName(OldF);
>> OldF->eraseFromParent();
>> is probably what you're looking for.
>> (Note: completely untested)
And I...
2011 Feb 28
0
[LLVMdev] Extending FunctionType
...I don't see a mechanism that
updates instructions that use the old function's arguments to use the
new function's arguments.
> Gabriel: look at Function::getBasicBlockList() and
> iplist<>::splice(iterator, iplist). Something like
> Function *NewF = Function::Create(NewFnType, OldF->getLinkage());
> NewF->getBasicBlockList().splice(NewF->begin(), OldF->getBasicBlockList());
> NewF->takeName(OldF);
> OldF->eraseFromParent();
> is probably what you're looking for.
> (Note: completely untested)
-- John T.
2011 Feb 28
0
[LLVMdev] Extending FunctionType
On 2/28/11 6:31 AM, Gabriel Rodríguez wrote:
> Hi all,
>
> I am trying to extend a FunctionType to include new parameters. In
> particular, I want to
> ensure that the main function has been declared with both argsc and
> argsv. However
> there seems to be no easy way to accomplish this:
> llvm::Function::getFunctionType() returns a
> a reference to a const object,
2011 Feb 28
2
[LLVMdev] Extending FunctionType
Hi all,
I am trying to extend a FunctionType to include new parameters. In particular, I want to
ensure that the main function has been declared with both argsc and argsv. However
there seems to be no easy way to accomplish this: llvm::Function::getFunctionType() returns a
a reference to a const object, while modifying only the argument list yields an error during verification
since the