mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-16 03:51:07 +00:00
experimental: support for debug info (#118)
Signed-off-by: wpt967 <matt.aw@parity.io> Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -11,6 +11,8 @@ pub mod yul_data;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use inkwell::debug_info::AsDIScope;
|
||||
|
||||
use crate::optimizer::settings::size_level::SizeLevel;
|
||||
use crate::optimizer::Optimizer;
|
||||
use crate::polkavm::context::attribute::Attribute;
|
||||
@@ -94,6 +96,14 @@ impl<'ctx> Function<'ctx> {
|
||||
self.declaration
|
||||
}
|
||||
|
||||
/// Returns the debug-info scope.
|
||||
pub fn get_debug_scope(&self) -> Option<inkwell::debug_info::DIScope<'ctx>> {
|
||||
self.declaration()
|
||||
.function_value()
|
||||
.get_subprogram()
|
||||
.map(|scp| scp.as_debug_info_scope())
|
||||
}
|
||||
|
||||
/// Returns the N-th parameter of the function.
|
||||
pub fn get_nth_param(&self, index: usize) -> inkwell::values::BasicValueEnum<'ctx> {
|
||||
self.declaration()
|
||||
|
||||
Reference in New Issue
Block a user