use of com.oracle.truffle.llvm.runtime.nodes.others.LLVMStatementRootNode in project graal by oracle.
the class InitializeModuleNode method createDestructor.
public static RootCallTarget createDestructor(LLVMParserResult parserResult, String moduleName, LLVMLanguage language) {
LLVMStatementNode[] destructors = createStructor(DESTRUCTORS_VARNAME, parserResult, DESCENDING_PRIORITY);
if (destructors.length > 0) {
NodeFactory nodeFactory = parserResult.getRuntime().getNodeFactory();
FrameDescriptor.Builder builder = FrameDescriptor.newBuilder();
nodeFactory.addStackSlots(builder);
FrameDescriptor frameDescriptor = builder.build();
LLVMStatementRootNode root = new LLVMStatementRootNode(language, StaticInitsNodeGen.create(destructors, "fini", moduleName), frameDescriptor, nodeFactory.createStackAccess());
return root.getCallTarget();
} else {
return null;
}
}
Aggregations