Search in sources :

Example 1 with LLVMSourceFunctionType

use of com.oracle.truffle.llvm.runtime.debug.LLVMSourceFunctionType in project sulong by graalvm.

the class DITypeExtractor method visit.

@Override
public void visit(MDSubroutine mdSubroutine) {
    final List<LLVMSourceType> members = new ArrayList<>();
    final LLVMSourceFunctionType type = new LLVMSourceFunctionType(members);
    parsedTypes.put(mdSubroutine, type);
    getElements(mdSubroutine.getTypes(), members, true);
}
Also used : ArrayList(java.util.ArrayList) LLVMSourceType(com.oracle.truffle.llvm.runtime.debug.LLVMSourceType) LLVMSourceFunctionType(com.oracle.truffle.llvm.runtime.debug.LLVMSourceFunctionType)

Example 2 with LLVMSourceFunctionType

use of com.oracle.truffle.llvm.runtime.debug.LLVMSourceFunctionType in project sulong by graalvm.

the class DebugInfoFunctionProcessor method initSourceFunction.

private void initSourceFunction(FunctionDefinition function, Source bitcodeSource) {
    final MDBaseNode debugInfo = getDebugInfo(function);
    LLVMSourceLocation scope = null;
    LLVMSourceFunctionType type = null;
    if (debugInfo != null) {
        scope = cache.buildLocation(debugInfo);
        LLVMSourceType actualType = cache.parseType(debugInfo);
        if (actualType instanceof LLVMSourceFunctionType) {
            type = (LLVMSourceFunctionType) actualType;
        }
    }
    if (scope == null) {
        final String sourceText = String.format("%s:%s", bitcodeSource.getName(), function.getName());
        final Source irSource = Source.newBuilder(sourceText).mimeType(DIScopeBuilder.getMimeType(null)).name(sourceText).build();
        final SourceSection simpleSection = irSource.createSection(1);
        scope = LLVMSourceLocation.createBitcodeFunction(function.getName(), simpleSection);
    }
    final SourceFunction sourceFunction = new SourceFunction(scope, type);
    function.setSourceFunction(sourceFunction);
    for (SourceVariable local : sourceFunction.getVariables()) {
        local.processFragments();
    }
}
Also used : MDBaseNode(com.oracle.truffle.llvm.parser.metadata.MDBaseNode) LLVMSourceLocation(com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceLocation) LLVMSourceType(com.oracle.truffle.llvm.runtime.debug.LLVMSourceType) SourceSection(com.oracle.truffle.api.source.SourceSection) LLVMSourceFunctionType(com.oracle.truffle.llvm.runtime.debug.LLVMSourceFunctionType) Source(com.oracle.truffle.api.source.Source)

Aggregations

LLVMSourceFunctionType (com.oracle.truffle.llvm.runtime.debug.LLVMSourceFunctionType)2 LLVMSourceType (com.oracle.truffle.llvm.runtime.debug.LLVMSourceType)2 Source (com.oracle.truffle.api.source.Source)1 SourceSection (com.oracle.truffle.api.source.SourceSection)1 MDBaseNode (com.oracle.truffle.llvm.parser.metadata.MDBaseNode)1 LLVMSourceLocation (com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceLocation)1 ArrayList (java.util.ArrayList)1