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);
}
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();
}
}
Aggregations