From f670551a30171a4c6b9fe984b8c12c9bbb55b684 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 22 Jul 2017 21:05:09 +0200 Subject: is_same_profile: handle enumeration_literal and function. Fix #388 --- src/vhdl/iirs_utils.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/vhdl') diff --git a/src/vhdl/iirs_utils.adb b/src/vhdl/iirs_utils.adb index ab4c8831d..9daf36c9a 100644 --- a/src/vhdl/iirs_utils.adb +++ b/src/vhdl/iirs_utils.adb @@ -1208,6 +1208,16 @@ package body Iirs_Utils is and then R_Kind = Iir_Kind_Enumeration_Literal then return Get_Type (L1) = Get_Type (R1); + elsif L_Kind = Iir_Kind_Enumeration_Literal + and then R_Kind = Iir_Kind_Function_Declaration + then + return Get_Interface_Declaration_Chain (R1) = Null_Iir + and then Get_Base_Type (Get_Return_Type (R1)) = Get_Type (L1); + elsif L_Kind = Iir_Kind_Function_Declaration + and then R_Kind = Iir_Kind_Enumeration_Literal + then + return Get_Interface_Declaration_Chain (L1) = Null_Iir + and then Get_Base_Type (Get_Return_Type (L1)) = Get_Type (R1); else -- Kind mismatch. return False; -- cgit v1.2.3