diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-09-02 21:17:16 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-09-02 21:17:16 +0200 |
commit | e6ffb98cb5ad3f07bcaf79323d8ab8411688c494 (patch) | |
tree | 46a91868b6e4aeb5354249c74507b3e92e85f01f /sem_psl.adb | |
parent | e393e8b7babd9d2dbe5e6bb7816b82036b857a1f (diff) | |
download | ghdl-e6ffb98cb5ad3f07bcaf79323d8ab8411688c494.tar.gz ghdl-e6ffb98cb5ad3f07bcaf79323d8ab8411688c494.tar.bz2 ghdl-e6ffb98cb5ad3f07bcaf79323d8ab8411688c494.zip |
Keep names in the tree.
This is a large change to improve error locations and allow pretty printing.
Diffstat (limited to 'sem_psl.adb')
-rw-r--r-- | sem_psl.adb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sem_psl.adb b/sem_psl.adb index 15b924ce9..cae63f740 100644 --- a/sem_psl.adb +++ b/sem_psl.adb @@ -146,8 +146,16 @@ package body Sem_Psl is begin Expr := Get_HDL_Node (N); if Get_Kind (Expr) in Iir_Kinds_Name then - Sem_Name (Expr, False); - Name := Get_Named_Entity (Expr); + Sem_Name (Expr); + Expr := Finish_Sem_Name (Expr); + Set_HDL_Node (N, Expr); + + if Get_Kind (Expr) in Iir_Kinds_Denoting_Name then + Name := Get_Named_Entity (Expr); + else + Name := Expr; + end if; + case Get_Kind (Name) is when Iir_Kind_Error => return N; @@ -183,9 +191,15 @@ package body Sem_Psl is Free_Iir (Expr); return Res; when Iir_Kind_Psl_Expression => + -- Remove the two bridge nodes: from PSL to HDL and from + -- HDL to PSL. Free_Node (N); + Res := Get_Psl_Expression (Name); Free_Iir (Expr); - return Get_Psl_Expression (Name); + if Name /= Expr then + Free_Iir (Name); + end if; + return Res; when others => Expr := Name; end case; |