use of com.oracle.truffle.llvm.runtime.nodes.intrinsics.llvm.LLVMIntrinsicRootNode.LLVMIntrinsicExpressionNode in project graal by oracle.
the class LLVMPrintStackTrace method fillStackTrace.
private static void fillStackTrace(SulongStackTrace stackTrace, Node node) {
LLVMBasicBlockNode block = NodeUtil.findParent(node, LLVMBasicBlockNode.class);
LLVMFunctionStartNode f = NodeUtil.findParent(node, LLVMFunctionStartNode.class);
if (block == null || f == null) {
LLVMIntrinsicExpressionNode intrinsic = NodeUtil.findParent(node, LLVMIntrinsicExpressionNode.class);
if (intrinsic != null) {
stackTrace.addStackTraceElement(intrinsic.toString(), null, null);
}
return;
}
LLVMSourceLocation location = null;
if (node instanceof LLVMInstrumentableNode) {
location = ((LLVMInstrumentableNode) node).getSourceLocation();
}
if (location == null) {
location = block.getSourceLocation();
}
if (location != null) {
stackTrace.addStackTraceElement(f.getOriginalName(), location, f.getBcName(), f.getBcSource().getName(), blockName(block));
return;
}
SourceSection s = node.getSourceSection();
if (s == null) {
s = f.getSourceSection();
}
if (s == null) {
stackTrace.addStackTraceElement(f.getBcName(), f.getBcSource().getName(), blockName(block));
} else {
location = LLVMSourceLocation.createUnknown(s);
stackTrace.addStackTraceElement(f.getOriginalName(), location, f.getBcName(), f.getBcSource().getName(), blockName(block));
}
}
Aggregations