Moved DSymbol into DCD

This commit is contained in:
WebFreak001 2022-10-13 22:18:18 +02:00 committed by Jan Jurzitza
parent 1656e77b9c
commit 2220812b96
12 changed files with 29 additions and 43 deletions

9
.gitmodules vendored
View File

@ -8,15 +8,12 @@
[submodule "containers"]
path = containers
url = https://github.com/dlang-community/containers.git
[submodule "dsymbol"]
path = dsymbol
url = https://github.com/dlang-community/dsymbol.git
[submodule "libddoc"]
path = libddoc
url = https://github.com/dlang-community/libddoc.git
[submodule "stdx-allocator"]
path = stdx-allocator
url = https://github.com/dlang-community/stdx-allocator.git
[submodule "d-test-utils"]
path = d-test-utils
url = https://github.com/dlang-community/d-test-utils.git
[submodule "DCD"]
path = DCD
url = https://github.com/dlang-community/DCD.git

1
DCD Submodule

@ -0,0 +1 @@
Subproject commit 5c529f300d3a64d9ce8729ff99e3007922719bc8

View File

@ -28,8 +28,6 @@ set INIFILED=
set DSYMBOL=
set CONTAINERS=
set LIBDDOC=
set STDXALLOCATOR=
set STDXALLOCATORBLOCKS=
for %%x in (src\dscanner\*.d) do set CORE=!CORE! %%x
for %%x in (src\dscanner\analysis\*.d) do set ANALYSIS=!ANALYSIS! %%x
@ -38,25 +36,23 @@ for %%x in (libdparse\src\std\experimental\*.d) do set LIBDPARSE=!LIBDPARSE! %%x
for %%x in (libddoc\src\ddoc\*.d) do set LIBDDOC=!LIBDDOC! %%x
for %%x in (libddoc\common\source\ddoc\*.d) do set LIBDDOC=!LIBDDOC! %%x
for %%x in (inifiled\source\*.d) do set INIFILED=!INIFILED! %%x
for %%x in (dsymbol\src\dsymbol\*.d) do set DSYMBOL=!DSYMBOL! %%x
for %%x in (dsymbol\src\dsymbol\builtin\*.d) do set DSYMBOL=!DSYMBOL! %%x
for %%x in (dsymbol\src\dsymbol\conversion\*.d) do set DSYMBOL=!DSYMBOL! %%x
for %%x in (DCD\dsymbol\src\dsymbol\*.d) do set DSYMBOL=!DSYMBOL! %%x
for %%x in (DCD\dsymbol\src\dsymbol\builtin\*.d) do set DSYMBOL=!DSYMBOL! %%x
for %%x in (DCD\dsymbol\src\dsymbol\conversion\*.d) do set DSYMBOL=!DSYMBOL! %%x
for %%x in (containers\src\containers\*.d) do set CONTAINERS=!CONTAINERS! %%x
for %%x in (containers\src\containers\internal\*.d) do set CONTAINERS=!CONTAINERS! %%x
for %%x in (stdx-allocator\source\stdx\allocator\*.d) do set STDXALLOCATOR=!STDXALLOCATOR! %%x
for %%x in (stdx-allocator\source\stdx\allocator\building_blocks\*.d) do set STDXALLOCATORBLOCKS=!STDXALLOCATORBLOCKS! %%x
if "%1" == "test" goto test_cmd
@echo on
%DC% %MFLAGS% %CORE% %STD% %LIBDPARSE% %LIBDDOC% %ANALYSIS% %INIFILED% %DSYMBOL% %CONTAINERS% %STDXALLOCATOR% %STDXALLOCATORBLOCKS% %DFLAGS% -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -I"libddoc\common\source" -I"stdx-allocator\source" -ofbin\dscanner.exe
%DC% %MFLAGS% %CORE% %STD% %LIBDPARSE% %LIBDDOC% %ANALYSIS% %INIFILED% %DSYMBOL% %CONTAINERS% %DFLAGS% -I"libdparse\src" -I"DCD\dsymbol\src" -I"containers\src" -I"libddoc\src" -I"libddoc\common\source" -ofbin\dscanner.exe
goto eof
:test_cmd
@echo on
set TESTNAME="bin\dscanner-unittest"
%DC% %MFLAGS% %STD% %LIBDPARSE% %LIBDDOC% %INIFILED% %DSYMBOL% %CONTAINERS% %STDXALLOCATOR% %STDXALLOCATORBLOCKS% -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -I"stdx-allocator\source" -lib %TESTFLAGS% -of%TESTNAME%.lib
if exist %TESTNAME%.lib %DC% %MFLAGS% %CORE% %ANALYSIS% %TESTNAME%.lib -I"src" -I"inifiled\source" -I"libdparse\src" -I"dsymbol\src" -I"containers\src" -I"libddoc\src" -I"libddoc\common\source" -I"stdx-allocator\source" -unittest %TESTFLAGS% -of%TESTNAME%.exe
%DC% %MFLAGS% %STD% %LIBDPARSE% %LIBDDOC% %INIFILED% %DSYMBOL% %CONTAINERS% -I"libdparse\src" -I"DCD\dsymbol\src" -I"containers\src" -I"libddoc\src" -lib %TESTFLAGS% -of%TESTNAME%.lib
if exist %TESTNAME%.lib %DC% %MFLAGS% %CORE% %ANALYSIS% %TESTNAME%.lib -I"src" -I"inifiled\source" -I"libdparse\src" -I"DCD\dsymbol\src" -I"containers\src" -I"libddoc\src" -I"libddoc\common\source" -unittest %TESTFLAGS% -of%TESTNAME%.exe
if exist %TESTNAME%.exe %TESTNAME%.exe
if exist %TESTNAME%.obj del %TESTNAME%.obj

@ -1 +1 @@
Subproject commit fc1625a5a0c253272b80addfb4107928495fd647
Subproject commit 116a02872039efbd0289828cd5eeff6f60bdf539

@ -1 +0,0 @@
Subproject commit 7e5aaa2c6c9bec226e51bcce2e0364ea3fd6a01d

View File

@ -12,12 +12,11 @@
"StdLoggerDisableWarning"
],
"dependencies" : {
"libdparse": "0.19.2",
"dsymbol" : "0.13.0",
"libdparse": "~>0.20.0",
"dcd:dsymbol" : "~>0.15.0-beta.1",
"inifiled" : "~>1.3.1",
"emsi_containers" : "~>0.8.0",
"libddoc" : "~>0.8.0",
"stdx-allocator" : "~>2.77.5"
"emsi_containers" : "~>0.9.0",
"libddoc" : "~>0.8.0"
},
"targetPath" : "bin",
"stringImportPaths" : [

@ -1 +1 @@
Subproject commit b94a1573acc5c5c6b21794970af5907f2a21822d
Subproject commit c3fa4e6eb3720c6aad9e9a772a919ccee2cf1215

View File

@ -8,13 +8,12 @@ LDC := ldc2
LIB_SRC := \
$(shell find containers/src -name "*.d")\
$(shell find dsymbol/src -name "*.d")\
$(shell find DCD/dsymbol/src -name "*.d")\
$(shell find inifiled/source/ -name "*.d")\
$(shell find libdparse/src/std/experimental/ -name "*.d")\
$(shell find libdparse/src/dparse/ -name "*.d")\
$(shell find libddoc/src -name "*.d") \
$(shell find libddoc/common/source -name "*.d") \
$(shell find stdx-allocator/source -name "*.d")
$(shell find libddoc/common/source -name "*.d")
PROJECT_SRC := $(shell find src/ -name "*.d")
SRC := $(LIB_SRC) $(PROJECT_SRC)
@ -40,11 +39,10 @@ INCLUDE_PATHS = \
-Isrc \
-Iinifiled/source \
-Ilibdparse/src \
-Idsymbol/src \
-IDCD/dsymbol/src \
-Icontainers/src \
-Ilibddoc/src \
-Ilibddoc/common/source \
-Istdx-allocator/source
-Ilibddoc/common/source
DMD_VERSIONS = -version=StdLoggerDisableWarning
DMD_DEBUG_VERSIONS = -version=dparse_verbose

View File

@ -16,8 +16,8 @@ import dsymbol.modulecache : ModuleCache;
import dscanner.analysis.config;
import dscanner.analysis.run;
import dscanner.analysis.base;
import stdx.allocator.mallocator;
import stdx.allocator;
import std.experimental.allocator.mallocator;
import std.experimental.allocator;
S between(S)(S value, S before, S after) if (isSomeString!S)
{
@ -56,7 +56,7 @@ void assertAnalyzerWarnings(string code, const StaticAnalysisConfig config,
const(Token)[] tokens;
const(Module) m = parseModule(file, cast(ubyte[]) code, &r, defaultErrorFormat, cache, false, tokens);
auto moduleCache = ModuleCache(new CAllocatorImpl!Mallocator);
ModuleCache moduleCache;
// Run the code and get any warnings
MessageSet rawWarnings = analyze("test", m, config, moduleCache, tokens);

View File

@ -22,10 +22,10 @@ import dparse.ast;
import dparse.rollback_allocator;
import std.typecons : scoped;
import stdx.allocator : CAllocatorImpl;
import stdx.allocator.mallocator : Mallocator;
import stdx.allocator.building_blocks.region : Region;
import stdx.allocator.building_blocks.allocator_list : AllocatorList;
import std.experimental.allocator : CAllocatorImpl;
import std.experimental.allocator.mallocator : Mallocator;
import std.experimental.allocator.building_blocks.region : Region;
import std.experimental.allocator.building_blocks.allocator_list : AllocatorList;
import dscanner.analysis.config;
import dscanner.analysis.base;
@ -368,7 +368,6 @@ MessageSet analyze(string fileName, const Module m, const StaticAnalysisConfig a
if (!staticAnalyze)
return null;
auto symbolAllocator = scoped!ASTAllocator();
version (unittest)
enum ut = true;
else
@ -380,8 +379,7 @@ MessageSet analyze(string fileName, const Module m, const StaticAnalysisConfig a
m.moduleDeclaration.moduleName.identifiers !is null)
moduleName = m.moduleDeclaration.moduleName.identifiers.map!(e => e.text).join(".");
scope first = new FirstPass(m, internString(fileName), symbolAllocator,
symbolAllocator, true, &moduleCache, null);
scope first = new FirstPass(m, internString(fileName), &moduleCache, null);
first.run();
secondPass(first.rootSymbol, first.moduleScope, moduleCache);

View File

@ -153,8 +153,7 @@ else
const(string[]) absImportPaths = importPaths.map!(a => a.absolutePath()
.buildNormalizedPath()).array();
auto alloc = scoped!(dsymbol.modulecache.ASTAllocator)();
auto moduleCache = ModuleCache(alloc);
ModuleCache moduleCache;
if (absImportPaths.length)
moduleCache.addImportPaths(absImportPaths);

@ -1 +0,0 @@
Subproject commit d6e6ce4a838e0dad43ef13f050f96627339cdccd