Skip to content

Commit fed8719

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents e3c5a26 + 159f09a commit fed8719

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ all: coverage-instrument
107107
ifeq ($(ALIRE),True)
108108
alr build -- -XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) $(GPRBUILD_FLAGS)
109109
else
110+
# We have our own s-memory.adb which overwrites the default System.Memory implementation
111+
# For unclear reasons, this file is not recompiled when the version of GNAT was changed
112+
# and we get link errors. As a workaround, we force its recompilation explicitly here.
113+
$(GPRBUILD) -d -ws -c -u -P gnat/lsp_server.gpr -p $(BUILD_FLAGS) s-memory.adb
110114
$(GPRBUILD) -P gnat/lsp_server.gpr -p $(COVERAGE_BUILD_FLAGS) \
111115
-XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) $(GPRBUILD_CARGS)
112116
endif

source/ada/lsp-ada_handlers-project_loading.adb

+37-6
Original file line numberDiff line numberDiff line change
@@ -838,18 +838,49 @@ package body LSP.Ada_Handlers.Project_Loading is
838838
(Self : in out Message_Handler'Class)
839839
is
840840
use GPR2;
841-
use GPR2.Build.Source.Sets;
841+
842+
procedure For_All_Part_Action
843+
(Kind : Unit_Kind;
844+
View : GPR2.Project.View.Object;
845+
Path : Path_Name.Object;
846+
Index : Unit_Index;
847+
Sep_Name : Optional_Name_Type);
848+
849+
-------------------------
850+
-- For_All_Part_Action --
851+
-------------------------
852+
853+
procedure For_All_Part_Action
854+
(Kind : Unit_Kind;
855+
View : GPR2.Project.View.Object;
856+
Path : Path_Name.Object;
857+
Index : Unit_Index;
858+
Sep_Name : Optional_Name_Type)
859+
is
860+
pragma Unreferenced (Kind);
861+
pragma Unreferenced (View);
862+
pragma Unreferenced (Index);
863+
pragma Unreferenced (Sep_Name);
864+
begin
865+
Self.Project_Predefined_Sources.Include (Path.Virtual_File);
866+
end For_All_Part_Action;
842867
begin
843868
Self.Project_Predefined_Sources.Clear;
844869

845870
if Self.Project_Tree.Is_Defined
846871
and then Self.Project_Tree.Has_Runtime_Project
847872
then
848-
for Source of Self.Project_Tree.Runtime_Project.Sources loop
849-
if Source.Language = GPR2.Ada_Language then
850-
Self.Project_Predefined_Sources.Include
851-
(Source.Path_Name.Virtual_File);
852-
end if;
873+
-- Note that the following loop differs rather subtly from iterating
874+
-- over the units in the runtime view: user projects are allowed to
875+
-- override units from the runtime, and when they do the overridden
876+
-- units should be ignored. We would incorrectly consider them if we
877+
-- just iterated over the units of the runtime view.
878+
for P of Self.Project_Tree.Namespace_Root_Projects loop
879+
for Unit of P.Units (With_Externally_Built => True) loop
880+
if Unit.Owning_View.Is_Runtime then
881+
Unit.For_All_Part (For_All_Part_Action'Access);
882+
end if;
883+
end loop;
853884
end loop;
854885
end if;
855886
end Update_Project_Predefined_Sources;

0 commit comments

Comments
 (0)