aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_inst.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/vhdl-sem_inst.adb')
-rw-r--r--src/vhdl/vhdl-sem_inst.adb13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-sem_inst.adb b/src/vhdl/vhdl-sem_inst.adb
index d920f4943..526c4224f 100644
--- a/src/vhdl/vhdl-sem_inst.adb
+++ b/src/vhdl/vhdl-sem_inst.adb
@@ -1220,4 +1220,17 @@ package body Vhdl.Sem_Inst is
end loop;
end Substitute_On_Chain;
+ function Get_Subprogram_Body_Origin (Spec : Iir) return Iir
+ is
+ Res : constant Iir := Get_Subprogram_Body (Spec);
+ Orig : Iir;
+ begin
+ if Res /= Null_Iir then
+ return Res;
+ else
+ Orig := Get_Origin (Spec);
+ pragma Assert (Orig /= Null_Iir);
+ return Get_Subprogram_Body_Origin (Orig);
+ end if;
+ end Get_Subprogram_Body_Origin;
end Vhdl.Sem_Inst;