MCPcopy Create free account
hub / github.com/digego/extempore / remove_function

Method remove_function

src/SchemeFFI.cpp:2402–2422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

string_valueFunction · 0.85
pair_carFunction · 0.85
getFunctionMethod · 0.80

Tested by

no test coverage detected