add method

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2025-02-26 12:04:23 +01:00
parent 95c6b624ae
commit f15ad78d44
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

View file

@ -26,6 +26,12 @@ pub struct MethodCFG<'a> {
pub nodes: Vec<MethodCFGNode<'a>>,
}
impl Method {
pub fn get_cfg(&self) -> Result<MethodCFG> {
MethodCFG::new(self)
}
}
impl<'a> MethodCFG<'a> {
pub fn new(method: &'a Method) -> Result<Self> {
let insns: &'a [Instruction] = if let Some(code) = method.code.as_ref() {