Search in sources :

Example 1 with LoadModulesNode

use of com.oracle.truffle.llvm.initialization.LoadModulesNode in project graal by oracle.

the class ParserDriver method createLibraryCallTarget.

/**
 * Creates the call target of the load module node, which initialise the library.
 *
 * @param name the name of the library
 * @param parserResult the {@link LLVMParserResult} for the library
 * @param source the {@link Source} of the library
 * @return the call target for initialising the library.
 */
private CallTarget createLibraryCallTarget(String name, LLVMParserResult parserResult, Source source) {
    if (context.getEnv().getOptions().get(SulongEngineOption.PARSE_ONLY)) {
        return RootNode.createConstantNode(0).getCallTarget();
    } else {
        // check if the functions should be resolved eagerly or lazily.
        boolean lazyParsing = context.getEnv().getOptions().get(SulongEngineOption.LAZY_PARSING) && !context.getEnv().getOptions().get(SulongEngineOption.AOTCacheStore);
        LoadModulesNode loadModules = LoadModulesNode.create(name, parserResult, lazyParsing, context.isInternalLibraryFile(parserResult.getRuntime().getFile()), libraryDependencies, source, language);
        return loadModules.getCallTarget();
    }
}
Also used : LoadModulesNode(com.oracle.truffle.llvm.initialization.LoadModulesNode)

Aggregations

LoadModulesNode (com.oracle.truffle.llvm.initialization.LoadModulesNode)1