| 2400 | } |
| 2401 | |
| 2402 | pointer SchemeFFI::remove_function(scheme* _sc, pointer args) |
| 2403 | { |
| 2404 | // Create some module to put our function into it. |
| 2405 | using namespace llvm; |
| 2406 | |
| 2407 | //Module* M = EXTLLVM::I()->M; |
| 2408 | //llvm::Function* func = M->getFunction(std::string(string_value(pair_car(args)))); |
| 2409 | llvm::Function* func = extemp::EXTLLVM::I()->getFunction(std::string(string_value(pair_car(args)))); |
| 2410 | if(func == 0) |
| 2411 | { |
| 2412 | return _sc->F; |
| 2413 | } |
| 2414 | if(func->mayBeOverridden()) { |
| 2415 | func->dropAllReferences(); |
| 2416 | func->removeFromParent(); |
| 2417 | return _sc->T; |
| 2418 | }else{ |
| 2419 | printf("Cannot remove function with dependencies\n"); |
| 2420 | return _sc->F; |
| 2421 | } |
| 2422 | } |
| 2423 | |
| 2424 | pointer SchemeFFI::erase_function(scheme* _sc, pointer args) |
| 2425 | { |
nothing calls this directly
no test coverage detected