-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/981' into 'master'
Refactor visibility checking for types See merge request eng/libadalang/libadalang!1427
- Loading branch information
Showing
10 changed files
with
188 additions
and
144 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package body Pkg_G is | ||
type U is null record; | ||
|
||
procedure Foo (X : T) is | ||
begin | ||
null; | ||
end Foo; | ||
end Pkg_G; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
generic | ||
package Pkg_G is | ||
type T is private; | ||
|
||
X : constant T; | ||
|
||
procedure Foo (X : T); | ||
private | ||
type T is null record; | ||
type U; | ||
|
||
X : constant T := (others => <>); | ||
end Pkg_G; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
with Pkg_G; | ||
|
||
procedure Test is | ||
package My_Pkg is new Pkg_G; | ||
begin | ||
My_Pkg.Foo (My_Pkg.X); | ||
--% fun = node.f_call.f_name.p_referenced_decl() | ||
--% typ_t = fun.findall(lal.Identifier)[2].p_referenced_decl() | ||
--% complete_t = typ_t.p_most_visible_part(fun.p_body_part()) | ||
--% typ_u = complete_t.next_sibling | ||
--% complete_u = typ_u.p_most_visible_part(fun.p_body_part()) | ||
end Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Working on node <CallStmt test.adb:6:4-6:26> | ||
============================================ | ||
|
||
Set 'fun' to 'node.f_call.f_name.p_referenced_decl()' | ||
Result: <| SubpDecl ["Foo"] pkg_g.ads:7:4-7:26 [test.adb:4:4] |> | ||
|
||
Set 'typ_t' to 'fun.findall(lal.Identifier)[2].p_referenced_decl()' | ||
Result: <| ConcreteTypeDecl ["T"] pkg_g.ads:3:4-3:22 [test.adb:4:4] |> | ||
|
||
Set 'complete_t' to 'typ_t.p_most_visible_part(fun.p_body_part())' | ||
Result: <| ConcreteTypeDecl ["T"] pkg_g.ads:9:4-9:26 [test.adb:4:4] |> | ||
|
||
Set 'typ_u' to 'complete_t.next_sibling' | ||
Result: <| IncompleteTypeDecl ["U"] pkg_g.ads:10:4-10:11 [test.adb:4:4] |> | ||
|
||
Set 'complete_u' to 'typ_u.p_most_visible_part(fun.p_body_part())' | ||
Result: <| ConcreteTypeDecl ["U"] pkg_g.adb:2:4-2:26 [test.adb:4:4] |> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
driver: inline-playground | ||
input_sources: [test.adb] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
procedure Test is | ||
package Pkg is | ||
type T is tagged private; | ||
|
||
type T_Access is access all T'Class; | ||
--% typ = node.f_type_def.f_subtype_indication.p_designated_type_decl | ||
--% typ.p_next_part | ||
private | ||
type T is tagged null record; | ||
end Pkg; | ||
begin | ||
end Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Working on node <ConcreteTypeDecl ["T_Access"] test.adb:5:7-5:43> | ||
================================================================= | ||
|
||
Set 'typ' to 'node.f_type_def.f_subtype_indication.p_designated_type_decl' | ||
Result: <ClasswideTypeDecl ["T"] test.adb:3:7-3:32> | ||
|
||
Eval 'typ.p_next_part' | ||
Result: <ClasswideTypeDecl ["T"] test.adb:9:7-9:36> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
driver: inline-playground | ||
input_sources: [test.adb] |