use of com.oracle.truffle.llvm.parser.metadata.debuginfo.SourceVariable in project sulong by graalvm.
the class LLVMBitcodeFunctionVisitor method visit.
@Override
public void visit(InstructionBlock block) {
List<Phi> blockPhis = phis.get(block);
ArrayList<LLVMLivenessAnalysis.NullerInformation> blockNullerInfos = liveness.getNullableWithinBlock()[block.getBlockIndex()];
LLVMBitcodeInstructionVisitor visitor = new LLVMBitcodeInstructionVisitor(frame, blockPhis, nodeFactory, argCount, symbols, runtime, blockNullerInfos, function.getSourceFunction(), notNullable, dbgInfoHandler);
if (initDebugValues) {
for (SourceVariable variable : function.getSourceFunction().getVariables()) {
final LLVMExpressionNode initNode = dbgInfoHandler.createInitializer(variable);
if (initNode != null) {
visitor.addInstructionUnchecked(initNode);
}
}
initDebugValues = false;
}
for (int i = 0; i < block.getInstructionCount(); i++) {
Instruction instruction = block.getInstruction(i);
visitor.setInstructionIndex(i);
instruction.accept(visitor);
}
blocks.add(nodeFactory.createBasicBlockNode(runtime, visitor.getInstructions(), visitor.getControlFlowNode(), block.getBlockIndex(), block.getName()));
}
use of com.oracle.truffle.llvm.parser.metadata.debuginfo.SourceVariable 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