Skip to content

Commit 1533cd2

Browse files
authored
Merge pull request #89 from rainers/master
changes for version 0.47
2 parents 7cbd35b + f1286f6 commit 1533cd2

File tree

91 files changed

+2466
-1142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2466
-1142
lines changed

CHANGES

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,3 +953,35 @@ Version history
953953
* indentation of lambdas as parameter arguments now aligns statements on tab stops
954954
* required OS version for executables restored to 5.01 to support Windows XP
955955
* mago: fix string display for LDC builds
956+
957+
unreleased Version 0.47.0
958+
959+
* dparser
960+
- support 'do' instead of 'body'
961+
* cv2pdb:
962+
- DWARF: several bug fixes and minor enhancements
963+
- can now convert DBG files alongside exe/dll
964+
* build system
965+
- msbuild:
966+
- improved dependency handling for single file compilation (thanks to Igor Cesi)
967+
- LDC now assumed to be multilib installation, i.e. 64-bit lib folder is "lib64", not "lib"
968+
- Issue 18641: phobos/druntime libraries automatically added to link if any D file
969+
is compiled in the project or a dependent static library (without -betterC)
970+
- Issue 18640: settings now default to mago debug engine (avoiding deprecation warning)
971+
- to use LDC with in VS2017, set "InstallationFolder" in registry HKEY_LOCAL_MACHINE\Software\LDC
972+
- now demangles linker errors (if not disabled on global options page)
973+
- new project wizard for customizing generated projects, with only two types to select from
974+
- new icons for project templates based on vcxproj
975+
- support option -gf (emit debug information for referenced types)
976+
* mago:
977+
- hex values now lower case for consistency with C++ debugger
978+
- no longer shows void pointers as expandable
979+
- show vtable of classes and interfaces as __vfptr (also allowed in watches, enable/disable
980+
on Tools->Options->Debugging-Mago page, not with LDC)
981+
- shows symbol names for pointers if found in image
982+
- pointers: also show value for pointee, remove additional indirection for complex types
983+
- support to call functions and delegates without arguments from watch window
984+
(dmd win64 only, no slice or delegate return values)
985+
- can now show the dynamic type of an interface
986+
* miscellaneous
987+
- Issue 18622: removed outdated information regarding link definition when generated by Visual D DLL project.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ dparser:
5353
vdextension:
5454
cd vdextensions && $(MSBUILD) vdextensions.csproj /p:Configuration=Release;Platform=x86 /t:Rebuild
5555

56+
visualdwizard:
57+
cd vdwizard && $(MSBUILD) VisualDWizard.csproj /p:Configuration=Release;Platform=AnyCPU /t:Rebuild
58+
5659
dbuild12:
5760
cd msbuild\dbuild && devenv /Build "Release|AnyCPU" /Project "dbuild" dbuild.sln
5861
# cd msbuild\dbuild && $(MSBUILD) dbuild.sln /p:Configuration=Release;Platform="Any CPU" /t:Rebuild
@@ -91,7 +94,7 @@ install_vs: install_modules dbuild15 install_only
9194

9295
install_vs_fake_dbuild15: install_modules fake_dbuild15 install_only
9396

94-
install_modules: prerequisites visuald_vs vdserver cv2pdb dparser vdextension mago dcxxfilt \
97+
install_modules: prerequisites visuald_vs vdserver cv2pdb dparser vdextension visualdwizard mago dcxxfilt \
9598
dbuild12 dbuild14
9699

97100
install_only:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Visual D
55
This is the README file for Visual D, a
66
Visual Studio package providing both project management and language services
77

8-
Copyright (c) 2010-2015 by Rainer Schuetze, All Rights Reserved
8+
Copyright (c) 2010-2018 by Rainer Schuetze, All Rights Reserved
99

1010
Visual D aims at providing seamless integration of the D programming language
1111
into Visual Studio.
@@ -61,6 +61,7 @@ Major Features
6161
- VS 2012
6262
- VS 2013
6363
- VS 2015
64+
- VS 2017
6465

6566
Unfortunately, Express versions of Visual Studio do not support this
6667
kind of extensions. Use the Visual Studio Shell instead:

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define VERSION_MAJOR 0
2-
#define VERSION_MINOR 46
2+
#define VERSION_MINOR 47
33
#define VERSION_REVISION 0
4-
#define VERSION_BETA
5-
#define VERSION_BUILD 0
4+
#define VERSION_BETA -beta
5+
#define VERSION_BUILD 1

appveyor.yml

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ environment:
2222
VS: 12
2323
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
2424

25+
# cache relative to C:\projects\visuald
26+
cache:
27+
- C:\projects\cache\dmd2080_0.7z
28+
- C:\projects\cache\cd851.zip
29+
- C:\projects\cache\VisualD-v0.45.1-rc2.exe
30+
2531
#matrix:
2632
# allow_failures:
2733
# - VS: 14
@@ -36,38 +42,41 @@ install:
3642
- set D_COMPILER=dmd
3743
- set
3844
- cd c:\projects
45+
- if not exist cache\nul mkdir cache
3946
# Download & extract D compiler
4047
- ps: |
4148
If ($Env:D_COMPILER -eq 'dmd') {
42-
Start-FileDownload 'http://downloads.dlang.org/releases/2.x/2.071.1/dmd.2.071.1.windows.7z' -FileName 'dmd2.7z'
49+
If (-not (Test-Path 'cache\dmd2080_0.7z')) {
50+
Start-FileDownload 'http://downloads.dlang.org/releases/2.x/2.080.0/dmd.2.080.0.windows.7z' -FileName 'cache\dmd2080_0.7z'
51+
}
52+
7z x cache\dmd2080_0.7z > $null
53+
Set-Item -path env:DMD -value c:\projects\dmd2\windows\bin\dmd.exe
54+
c:\projects\dmd2\windows\bin\dmd.exe --version
55+
} ElseIf ($Env:D_COMPILER -eq 'dmd-nightly') {
56+
Start-FileDownload 'http://nightlies.dlang.org/dmd-nightly/dmd.master.windows.7z' -FileName 'dmd2.7z'
4357
7z x dmd2.7z > $null
4458
Set-Item -path env:DMD -value c:\projects\dmd2\windows\bin\dmd.exe
4559
c:\projects\dmd2\windows\bin\dmd.exe --version
46-
} Else {
47-
If ($Env:D_COMPILER -eq 'dmd-nightly') {
48-
Start-FileDownload 'http://nightlies.dlang.org/dmd-nightly/dmd.master.windows.7z' -FileName 'dmd2.7z'
49-
7z x dmd2.7z > $null
50-
Set-Item -path env:DMD -value c:\projects\dmd2\windows\bin\dmd.exe
51-
c:\projects\dmd2\windows\bin\dmd.exe --version
52-
} Else {
53-
# LDC unsupported so far
54-
If ($Env:D_COMPILER -eq 'ldc') {
55-
Start-FileDownload 'http://github.com/ldc-developers/ldc/releases/download/v1.0.0/ldc2-1.0.0-win64-msvc.zip' -FileName 'ldc2.zip'
56-
7z x ldc2.zip > $null
57-
Set-Item -path env:DMD -value c:\projects\ldc2-1.0.0-win64-msvc\bin\ldmd2.exe
58-
c:\projects\ldc2-1.0.0-win64-msvc\bin\ldc2 --version
59-
}
60-
}
60+
} ElseIf ($Env:D_COMPILER -eq 'ldc') {
61+
# LDC unsupported so far
62+
Start-FileDownload 'http://github.com/ldc-developers/ldc/releases/download/v1.0.0/ldc2-1.0.0-win64-msvc.zip' -FileName 'ldc2.zip'
63+
7z x ldc2.zip > $null
64+
Set-Item -path env:DMD -value c:\projects\ldc2-1.0.0-win64-msvc\bin\ldmd2.exe
65+
c:\projects\ldc2-1.0.0-win64-msvc\bin\ldc2 --version
6166
}
6267
# Download & extract coffimplib.exe (no longer available publically as a single download)
6368
- ps: |
64-
Start-FileDownload 'http://ftp.digitalmars.com/Digital_Mars_C++/Patch/cd851.zip' -FileName 'cd851.zip'
65-
7z x cd851.zip > $null
69+
If (-not (Test-Path 'cache\cd851.7z')) {
70+
Start-FileDownload 'http://ftp.digitalmars.com/Digital_Mars_C++/Patch/cd851.zip' -FileName 'cache\cd851.zip'
71+
}
72+
7z x cache\cd851.zip > $null
6673
copy c:\projects\dm\bin\coffimplib.exe c:\projects\dmd2\windows\bin
6774
# Download & install Visual D
6875
- ps: |
69-
Start-FileDownload 'https://github.com/dlang/visuald/releases/download/v0.45.1-rc2/VisualD-v0.45.1-rc2.exe' -FileName 'VisualD-v0.45.1-rc2.exe'
70-
- .\VisualD-v0.45.1-rc2.exe /S
76+
If (-not (Test-Path 'cache\VisualD-v0.45.1-rc2.exe')) {
77+
Start-FileDownload 'https://github.com/dlang/visuald/releases/download/v0.45.1-rc2/VisualD-v0.45.1-rc2.exe' -FileName 'cache\VisualD-v0.45.1-rc2.exe'
78+
}
79+
- cache\VisualD-v0.45.1-rc2.exe /S
7180
# configure DMD path
7281
- reg add "HKLM\SOFTWARE\Microsoft\VisualStudio\12.0\ToolsOptionsPages\Projects\Visual D Settings" /v DMDInstallDir /t REG_SZ /d c:\projects\dmd2 /reg:32 /f
7382
- reg add "HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\ToolsOptionsPages\Projects\Visual D Settings" /v DMDInstallDir /t REG_SZ /d c:\projects\dmd2 /reg:32 /f

build/build.visualdproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,10 @@ dmd -m32mscoff -map "$(IntDir)\$(InputName).map" "-of$(OutDir)\$(
347347
<Config name="Release COFF32|Win32" customcmd="if exist &quot;$(VSINSTALLDIR)\Common7\Tools\vsvars32.bat&quot; call &quot;$(VSINSTALLDIR)\Common7\Tools\vsvars32.bat&quot;
348348
if exist &quot;$(VCINSTALLDIR)\Auxiliary\Build\vcvars32.bat&quot; ( pushd . &amp;&amp; call &quot;$(VCINSTALLDIR)\Auxiliary\Build\vcvars32.bat&quot; &amp;&amp; popd )
349349
if errorlevel 1 goto reportError
350-
dmd -m32mscoff -map &quot;$(IntDir)\$(InputName).map&quot; &quot;-of$(OutDir)\$(InputName).exe&quot; $(InputPath) ..\tools\nostacktrace.d user32.lib -L/SUBSYSTEM:CONSOLE,5.01" tool="Custom" dependencies="..\tools\nostacktrace.d" outfile="$(OutDir)\$(InputName).exe" />
350+
dmd -m32mscoff -version=pipeLink -map &quot;$(IntDir)\pipelink.map&quot; &quot;-of$(OutDir)\pipelink.exe&quot; $(InputPath) ..\tools\nostacktrace.d user32.lib -L/SUBSYSTEM:CONSOLE,5.01
351+
if errorlevel 1 goto reportError
352+
dmd -m32mscoff -map &quot;$(IntDir)\$(InputName).map&quot; &quot;-of$(OutDir)\$(InputName).exe&quot; $(InputPath) ..\tools\nostacktrace.d user32.lib -L/SUBSYSTEM:CONSOLE,5.01
353+
" tool="Custom" dependencies="..\tools\nostacktrace.d" outfile="$(OutDir)\$(InputName).exe" />
351354
<Config name="Debug|Win32" customcmd="dmd -g -map &quot;$(IntDir)\$(InputName).map&quot; &quot;-of$(OutDir)\$(InputName).exe&quot; &quot;-od$(IntDir)&quot; $(InputPath) ..\tools\nostacktrace.d
352355
&quot;$(VisualDInstallDir)\cv2pdb\cv2pdb.exe&quot; &quot;$(OutDir)\$(InputName).exe&quot;" tool="Custom" dependencies="..\tools\nostacktrace.d" outfile="$(OutDir)\$(InputName).exe" />
353356
</File>

c2d/idl2d.d

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,42 @@ class idl2d
339339
}
340340
}
341341

342+
bool hasBalancedBrackets(TokenIterator start, TokenIterator end)
343+
{
344+
int[] brackets;
345+
while (start != end)
346+
{
347+
int type = start.type;
348+
switch(type)
349+
{
350+
case Token.ParenL:
351+
case Token.BracketL:
352+
case Token.BraceL:
353+
brackets ~= type;
354+
break;
355+
case Token.ParenR:
356+
if (brackets.empty || brackets[$-1] != Token.ParenL)
357+
return false;
358+
brackets = brackets[0..$-1];
359+
break;
360+
case Token.BracketR:
361+
if (brackets.empty || brackets[$-1] != Token.BracketL)
362+
return false;
363+
brackets = brackets[0..$-1];
364+
break;
365+
case Token.BraceR:
366+
if (brackets.empty || brackets[$-1] != Token.BraceL)
367+
return false;
368+
brackets = brackets[0..$-1];
369+
break;
370+
default:
371+
break;
372+
}
373+
start++;
374+
}
375+
return brackets.empty;
376+
}
377+
342378
bool isExpression(TokenIterator start, TokenIterator end)
343379
{
344380
if(start == end || start.type == Token.EOF)
@@ -348,7 +384,7 @@ class idl2d
348384
for(TokenIterator it = start + 1; it != end && !it.atEnd() && it.type != Token.EOF; ++it)
349385
if(!isExpressionToken(it, false))
350386
return false;
351-
return true;
387+
return hasBalancedBrackets(start, end);
352388
}
353389

354390
bool isPrimaryExpr(TokenIterator it)
@@ -569,6 +605,10 @@ class idl2d
569605
case "_M_HYBRID_X86_ARM64":
570606
return -1;
571607

608+
// Windows SDK 10.0.17134.0
609+
case "IMAGE_POLICY_METADATA_NAME":
610+
return 1;
611+
572612
default:
573613
break;
574614
}
@@ -876,7 +916,7 @@ version(none){
876916
convert = false;
877917
if(tokIt[3].text == ")")
878918
{
879-
convertMacro = true;
919+
convertMacro = hasBalancedBrackets(tokIt + 4, endIt);
880920
argtype = "";
881921
if(isExpression(tokIt + 4, endIt))
882922
rettype = getExpressionType(ident, tokIt + 4, endIt);
@@ -1236,6 +1276,9 @@ version(all)
12361276
replaceTokenSequence(tokens, "template $args _ENUM_FLAG_INTEGER_FOR_SIZE;", "/*$0*/", true);
12371277
replaceTokenSequence(tokens, "template <> struct _ENUM_FLAG_INTEGER_FOR_SIZE <$arg> { $def };", "/*$0*/", true);
12381278
replaceTokenSequence(tokens, "template <$arg> struct _ENUM_FLAG_SIZED_INTEGER { $def };", "/*$0*/", true);
1279+
1280+
// win 10.0.17134.0: typedef enum MEM_EXTENDED_PARAMETER_TYPE {} MEM_EXTENDED_PARAMETER_TYPE, ...
1281+
replaceTokenSequence(tokens, "MEM_EXTENDED_PARAMETER_TYPE, *PMEM_EXTENDED_PARAMETER_TYPE", "*PMEM_EXTENDED_PARAMETER_TYPE", true);
12391282
}
12401283

12411284
if(currentModule == "commctrl")
@@ -1662,7 +1705,10 @@ version(none)
16621705
replaceTokenSequence(tokens, "enum $_ident1 { $enums }; typedef $_identbase $_ident2;",
16631706
"enum $_ident2 : $_identbase\n{\n$enums\n}", true);
16641707
} else {
1665-
replaceTokenSequence(tokens, "typedef enum $_ident1 { $enums } $_ident1;",
1708+
replaceTokenSequence(tokens, "typedef enum $_ident1 : uint { $enums } $_ident1;",
1709+
"enum $_ident1 : uint\n{\n$enums\n}\n", true);
1710+
1711+
replaceTokenSequence(tokens, "typedef enum $_ident1 { $enums } $_ident1;",
16661712
"enum /+$_ident1+/\n{\n$enums\n}\ntypedef int $_ident1;", true);
16671713
replaceTokenSequence(tokens, "typedef enum $_ident1 { $enums } $ident2;",
16681714
"enum /+$_ident1+/\n{\n$enums\n}\ntypedef int $_ident1;\ntypedef int $ident2;", true);
@@ -1941,9 +1987,14 @@ version(all) {
19411987
replaceTokenSequence(tokens, "sizeof($_ident)", "$_ident.sizeof", true);
19421988
replaceTokenSequence(tokens, "sizeof($args)", "($args).sizeof", true);
19431989

1990+
// Win SDK 10.0,17136,0
1991+
replaceTokenSequence(tokens, "_Out_writes_z_($args)", "/+$*+/", true);
1992+
replaceTokenSequence(tokens, "_IRQL_requires_max_($args)", "/+$*+/", true);
1993+
19441994
// bitfields:
19451995
replaceTokenSequence(tokens, "$_identtype $_identname : $_num;", "__bf $_identtype, __quote $_identname __quote, $_num __eobf", true);
19461996
replaceTokenSequence(tokens, "$_identtype $_identname : $_ident;", "__bf $_identtype, __quote $_identname __quote, $_ident __eobf", true);
1997+
replaceTokenSequence(tokens, "$_identtype $_identname : $_num - $_identconst;", "__bf $_identtype, __quote $_identname __quote, $_num - $_identconst __eobf", true);
19471998
replaceTokenSequence(tokens, "$_identtype : $_num;", "__bf $_identtype, __quote __quote, $_num __eobf", true);
19481999
replaceTokenSequence(tokens, "__eobf __bf", ",\n\t", true);
19492000
replaceTokenSequence(tokens, "__bf", "mixin(bitfields!(", true);

msbuild/dbuild/CompileD.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public CompileD()
4242
this.switchOrderList.Add("Main");
4343
this.switchOrderList.Add("DebugCode");
4444
this.switchOrderList.Add("DebugInfo");
45+
this.switchOrderList.Add("DebugFull");
4546
this.switchOrderList.Add("BoundsCheck");
4647
this.switchOrderList.Add("PerformSyntaxCheckOnly");
4748

@@ -412,6 +413,17 @@ public string DebugInfo
412413
}
413414
}
414415

416+
public bool DebugFull
417+
{
418+
get { return GetBoolProperty("DebugFull"); }
419+
set
420+
{
421+
SetBoolProperty("DebugFull", "Full Debug Info",
422+
"Emit debug info for all referenced types (-gf)",
423+
"-gf", value);
424+
}
425+
}
426+
415427
public string BoundsCheck
416428
{
417429
get { return GetStringProperty("BoundsCheck"); }

0 commit comments

Comments
 (0)