use of com.oracle.truffle.llvm.runtime.LLVMFunctionCode.Function in project graal by oracle.
the class LLVMParser method defineFunction.
private void defineFunction(FunctionSymbol functionSymbol, ModelModule model, DataLayout dataLayout) {
assert !functionSymbol.isExternal();
// handle the file scope
FunctionDefinition functionDefinition = (FunctionDefinition) functionSymbol;
LazyToTruffleConverterImpl lazyConverter = new LazyToTruffleConverterImpl(runtime, functionDefinition, source, model.getFunctionParser(functionDefinition), model.getFunctionProcessor(), dataLayout);
Function function = new LazyLLVMIRFunction(lazyConverter);
LLVMFunction llvmFunction = LLVMFunction.create(functionSymbol.getName(), function, functionSymbol.getType(), runtime.getBitcodeID(), functionSymbol.getIndex(), functionDefinition.isExported(), runtime.getFile().getPath(), functionDefinition.isExternalWeak());
lazyConverter.setRootFunction(llvmFunction);
runtime.getFileScope().register(llvmFunction);
registerInPublicFileScope(llvmFunction);
final boolean cxxInterop = LLVMLanguage.getContext().getEnv().getOptions().get(SulongEngineOption.CXX_INTEROP);
if (cxxInterop) {
model.getFunctionParser(functionDefinition).parseLinkageName(runtime);
}
}
Aggregations