Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
{
# Install dmd for the associated tools (dub/rdmd)
version: dmd-latest,
dmd: gdmd
dmd: gdc-12
}
]
host: [
ubuntu-latest,
ubuntu-22.04,
macos-latest,
windows-latest
]
Expand All @@ -50,15 +50,15 @@ jobs:
exclude:
# Restrict GDC to Ubuntu
- compiler:
dmd: gdmd
dmd: gdc-12
host: windows-latest
- compiler:
dmd: gdmd
dmd: gdc-12
host: macos-latest

# Omit dub builds for GDC because dub rejects the old fronted revision
- compiler:
dmd: gdmd
dmd: gdc-12
build:
type: dub

Expand All @@ -75,17 +75,17 @@ jobs:
# Install the host compiler (DMD or LDC)
# Also grabs DMD for GDC to include dub + rdmd
- name: Install ${{ matrix.compiler.version }}
if: ${{ matrix.compiler.dmd != 'gdmd' || matrix.build.type == 'dub' }} # Fetch required tools for GDC
if: ${{ matrix.compiler.dmd != 'gdc-12' || matrix.build.type == 'dub' }} # Fetch required tools for GDC
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.compiler.version }}

# GDC not yet supported by setup-dlang
- name: Install GDC via apt-get
if: ${{ matrix.compiler.dmd == 'gdmd' }}
if: ${{ matrix.compiler.dmd == 'gdc-12' }}
run: |
sudo apt-get install gdc gdmd -y
gdc --version
sudo apt-get install gdc-12 -y
gdc-12 --version

# Compile D-Scanner and execute all tests without dub
- name: Build and test without dub
Expand Down
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions DCD
Submodule DCD added at 5c529f
16 changes: 6 additions & 10 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion dsymbol
Submodule dsymbol deleted from 7e5aaa
9 changes: 4 additions & 5 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : [
Expand Down
14 changes: 7 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand All @@ -56,7 +54,9 @@ GDC_DEBUG_VERSIONS = -fversion=dparse_verbose
DC_FLAGS += -Jbin
override DMD_FLAGS += $(DFLAGS) -w -release -O -od${OBJ_DIR}
override LDC_FLAGS += $(DFLAGS) -O5 -release -oq
override GDC_FLAGS += $(DFLAGS) -O3 -frelease
override GDC_FLAGS += $(DFLAGS) -O3 -frelease -fall-instantiations

override GDC_TEST_FLAGS += -fall-instantiations

DC_TEST_FLAGS += -g -Jbin
override DMD_TEST_FLAGS += -w
Expand Down
6 changes: 3 additions & 3 deletions src/dscanner/analysis/helpers.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 5 additions & 7 deletions src/dscanner/analysis/run.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/dscanner/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion stdx-allocator
Submodule stdx-allocator deleted from d6e6ce