Displaying 1 result from an estimated 1 matches for "mainfptr".
Did you mean:
mainfnptr
2013 Nov 21
1
[LLVMdev] Replacing C-style function
...= main->getFunction( "mainOfLibrary" );
ee->freeMachineCodeForFunction( mainf );
ee->freeMachineCodeForFunction( print1f );
print1f->replaceAllUsesWith( print2f );
print1f->deleteBody();
print1f->dropAllReferences();
print1f->eraseFromParent();
mainfPtr = ee->recompileAndRelinkFunction( mainf );
ASSERT_NE( mainfPtr, nullptr );
ret = ((int(*)(void))(mainfPtr))();
EXPECT_EQ(0xbeefdead, ret);
Can you please let me know if I am missing something in the steps above.
Does the "extern C" in the code snippet make any difference? I...