use of com.oracle.truffle.llvm.parser.metadata.MDExpression in project sulong by graalvm.
the class LLVMRuntimeDebugInformation method registerStaticDebugSymbols.
void registerStaticDebugSymbols(FunctionDefinition fn) {
if (!isEnabled) {
return;
}
for (SourceVariable local : fn.getSourceFunction().getVariables()) {
if (local.isSingleDeclaration()) {
final DbgDeclareInstruction dbg = local.getSingleDeclaration();
FrameSlot frameSlot = null;
if (dbg.getValue() instanceof AllocateInstruction) {
frameSlot = frame.findFrameSlot(((AllocateInstruction) dbg.getValue()).getName());
}
if (frameSlot == null) {
continue;
}
final LLVMSourceSymbol symbol = local.getSymbol();
final LLVMFrameValueAccess alloc = factory.createDebugFrameValue(frameSlot, true);
notNullableSlots.add(frameSlot);
context.getSourceContext().registerFrameValue(symbol, alloc);
local.addStaticValue();
} else if (local.isSingleValue()) {
final DbgValueInstruction dbg = local.getSingleValue();
final MDExpression expr = dbg.getExpression();
final SymbolImpl value = dbg.getValue();
if (expr.getElementCount() != 0) {
continue;
}
final boolean mustDereference = mustDereferenceValue(expr, local.getSourceType(), value);
staticValueAccessVisitor.registerStaticAccess(local, value, mustDereference);
}
}
}
Aggregations