Skip to content

Commit 2220812

Browse files
committed
Moved DSymbol into DCD
1 parent 1656e77 commit 2220812

File tree

12 files changed

+29
-43
lines changed

12 files changed

+29
-43
lines changed

.gitmodules

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
[submodule "containers"]
99
path = containers
1010
url = https://github.com/dlang-community/containers.git
11-
[submodule "dsymbol"]
12-
path = dsymbol
13-
url = https://github.com/dlang-community/dsymbol.git
1411
[submodule "libddoc"]
1512
path = libddoc
1613
url = https://github.com/dlang-community/libddoc.git
17-
[submodule "stdx-allocator"]
18-
path = stdx-allocator
19-
url = https://github.com/dlang-community/stdx-allocator.git
2014
[submodule "d-test-utils"]
2115
path = d-test-utils
2216
url = https://github.com/dlang-community/d-test-utils.git
17+
[submodule "DCD"]
18+
path = DCD
19+
url = https://github.com/dlang-community/DCD.git

DCD

Submodule DCD added at 5c529f3

build.bat

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ set INIFILED=
2828
set DSYMBOL=
2929
set CONTAINERS=
3030
set LIBDDOC=
31-
set STDXALLOCATOR=
32-
set STDXALLOCATORBLOCKS=
3331

3432
for %%x in (src\dscanner\*.d) do set CORE=!CORE! %%x
3533
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
3836
for %%x in (libddoc\src\ddoc\*.d) do set LIBDDOC=!LIBDDOC! %%x
3937
for %%x in (libddoc\common\source\ddoc\*.d) do set LIBDDOC=!LIBDDOC! %%x
4038
for %%x in (inifiled\source\*.d) do set INIFILED=!INIFILED! %%x
41-
for %%x in (dsymbol\src\dsymbol\*.d) do set DSYMBOL=!DSYMBOL! %%x
42-
for %%x in (dsymbol\src\dsymbol\builtin\*.d) do set DSYMBOL=!DSYMBOL! %%x
43-
for %%x in (dsymbol\src\dsymbol\conversion\*.d) do set DSYMBOL=!DSYMBOL! %%x
39+
for %%x in (DCD\dsymbol\src\dsymbol\*.d) do set DSYMBOL=!DSYMBOL! %%x
40+
for %%x in (DCD\dsymbol\src\dsymbol\builtin\*.d) do set DSYMBOL=!DSYMBOL! %%x
41+
for %%x in (DCD\dsymbol\src\dsymbol\conversion\*.d) do set DSYMBOL=!DSYMBOL! %%x
4442
for %%x in (containers\src\containers\*.d) do set CONTAINERS=!CONTAINERS! %%x
4543
for %%x in (containers\src\containers\internal\*.d) do set CONTAINERS=!CONTAINERS! %%x
46-
for %%x in (stdx-allocator\source\stdx\allocator\*.d) do set STDXALLOCATOR=!STDXALLOCATOR! %%x
47-
for %%x in (stdx-allocator\source\stdx\allocator\building_blocks\*.d) do set STDXALLOCATORBLOCKS=!STDXALLOCATORBLOCKS! %%x
4844

4945
if "%1" == "test" goto test_cmd
5046

5147
@echo on
52-
%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
48+
%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
5349
goto eof
5450

5551
:test_cmd
5652
@echo on
5753
set TESTNAME="bin\dscanner-unittest"
58-
%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
59-
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
54+
%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
55+
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
6056
if exist %TESTNAME%.exe %TESTNAME%.exe
6157

6258
if exist %TESTNAME%.obj del %TESTNAME%.obj

dsymbol

Lines changed: 0 additions & 1 deletion
This file was deleted.

dub.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
"StdLoggerDisableWarning"
1313
],
1414
"dependencies" : {
15-
"libdparse": "0.19.2",
16-
"dsymbol" : "0.13.0",
15+
"libdparse": "~>0.20.0",
16+
"dcd:dsymbol" : "~>0.15.0-beta.1",
1717
"inifiled" : "~>1.3.1",
18-
"emsi_containers" : "~>0.8.0",
19-
"libddoc" : "~>0.8.0",
20-
"stdx-allocator" : "~>2.77.5"
18+
"emsi_containers" : "~>0.9.0",
19+
"libddoc" : "~>0.8.0"
2120
},
2221
"targetPath" : "bin",
2322
"stringImportPaths" : [

makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ LDC := ldc2
88

99
LIB_SRC := \
1010
$(shell find containers/src -name "*.d")\
11-
$(shell find dsymbol/src -name "*.d")\
11+
$(shell find DCD/dsymbol/src -name "*.d")\
1212
$(shell find inifiled/source/ -name "*.d")\
1313
$(shell find libdparse/src/std/experimental/ -name "*.d")\
1414
$(shell find libdparse/src/dparse/ -name "*.d")\
1515
$(shell find libddoc/src -name "*.d") \
16-
$(shell find libddoc/common/source -name "*.d") \
17-
$(shell find stdx-allocator/source -name "*.d")
16+
$(shell find libddoc/common/source -name "*.d")
1817
PROJECT_SRC := $(shell find src/ -name "*.d")
1918
SRC := $(LIB_SRC) $(PROJECT_SRC)
2019

@@ -40,11 +39,10 @@ INCLUDE_PATHS = \
4039
-Isrc \
4140
-Iinifiled/source \
4241
-Ilibdparse/src \
43-
-Idsymbol/src \
42+
-IDCD/dsymbol/src \
4443
-Icontainers/src \
4544
-Ilibddoc/src \
46-
-Ilibddoc/common/source \
47-
-Istdx-allocator/source
45+
-Ilibddoc/common/source
4846

4947
DMD_VERSIONS = -version=StdLoggerDisableWarning
5048
DMD_DEBUG_VERSIONS = -version=dparse_verbose

src/dscanner/analysis/helpers.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import dsymbol.modulecache : ModuleCache;
1616
import dscanner.analysis.config;
1717
import dscanner.analysis.run;
1818
import dscanner.analysis.base;
19-
import stdx.allocator.mallocator;
20-
import stdx.allocator;
19+
import std.experimental.allocator.mallocator;
20+
import std.experimental.allocator;
2121

2222
S between(S)(S value, S before, S after) if (isSomeString!S)
2323
{
@@ -56,7 +56,7 @@ void assertAnalyzerWarnings(string code, const StaticAnalysisConfig config,
5656
const(Token)[] tokens;
5757
const(Module) m = parseModule(file, cast(ubyte[]) code, &r, defaultErrorFormat, cache, false, tokens);
5858

59-
auto moduleCache = ModuleCache(new CAllocatorImpl!Mallocator);
59+
ModuleCache moduleCache;
6060

6161
// Run the code and get any warnings
6262
MessageSet rawWarnings = analyze("test", m, config, moduleCache, tokens);

src/dscanner/analysis/run.d

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import dparse.ast;
2222
import dparse.rollback_allocator;
2323
import std.typecons : scoped;
2424

25-
import stdx.allocator : CAllocatorImpl;
26-
import stdx.allocator.mallocator : Mallocator;
27-
import stdx.allocator.building_blocks.region : Region;
28-
import stdx.allocator.building_blocks.allocator_list : AllocatorList;
25+
import std.experimental.allocator : CAllocatorImpl;
26+
import std.experimental.allocator.mallocator : Mallocator;
27+
import std.experimental.allocator.building_blocks.region : Region;
28+
import std.experimental.allocator.building_blocks.allocator_list : AllocatorList;
2929

3030
import dscanner.analysis.config;
3131
import dscanner.analysis.base;
@@ -368,7 +368,6 @@ MessageSet analyze(string fileName, const Module m, const StaticAnalysisConfig a
368368
if (!staticAnalyze)
369369
return null;
370370

371-
auto symbolAllocator = scoped!ASTAllocator();
372371
version (unittest)
373372
enum ut = true;
374373
else
@@ -380,8 +379,7 @@ MessageSet analyze(string fileName, const Module m, const StaticAnalysisConfig a
380379
m.moduleDeclaration.moduleName.identifiers !is null)
381380
moduleName = m.moduleDeclaration.moduleName.identifiers.map!(e => e.text).join(".");
382381

383-
scope first = new FirstPass(m, internString(fileName), symbolAllocator,
384-
symbolAllocator, true, &moduleCache, null);
382+
scope first = new FirstPass(m, internString(fileName), &moduleCache, null);
385383
first.run();
386384

387385
secondPass(first.rootSymbol, first.moduleScope, moduleCache);

src/dscanner/main.d

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ else
153153
const(string[]) absImportPaths = importPaths.map!(a => a.absolutePath()
154154
.buildNormalizedPath()).array();
155155

156-
auto alloc = scoped!(dsymbol.modulecache.ASTAllocator)();
157-
auto moduleCache = ModuleCache(alloc);
156+
ModuleCache moduleCache;
158157

159158
if (absImportPaths.length)
160159
moduleCache.addImportPaths(absImportPaths);

stdx-allocator

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)