Skip to content

Commit 6f0e245

Browse files
authored
Merge pull request #113 from rainers/master
Visual D 0.50.0-beta2
2 parents e870dbf + 76e3756 commit 6f0e245

File tree

17 files changed

+331
-126
lines changed

17 files changed

+331
-126
lines changed

CHANGES

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,10 +1121,19 @@ unreleased Version 0.50.0
11211121
* VS 16.1 Preview 2: ignore tracked files in *.delete.*.tlog as dependencies, too
11221122
* now another installer available that includes DMD and LDC
11231123
* installer no longer asks for DMD path when updating existing installation
1124-
* check for updates for Visual D, DMD and LDC, assisted download and install
1124+
* check for updates for Visual D, DMD and LDC, assisted download and install
1125+
* check and report invalid non-empty DMD/LDC installation folders
11251126
* experimental highlight references to the same symbol as the one at the caret
1126-
* new VC projects now determine Windows SDK automatically
1127-
* VC project: "New item" now also allows adding D module
1127+
* VC project:
1128+
- new projects now determine Windows SDK automatically
1129+
- DMD: fix wrong selections for bounds check options
1130+
- LDC: added -mixin option
1131+
- added enable -mixin option to autogenerate files according to the compilation model
1132+
- "New item" now also allows adding D module
1133+
- new option for -extern-std=c++xx
1134+
* visualdproj:
1135+
- Error List: classify warnings and deprecations according to the respective options
1136+
* bugzilla 19930: visualdproj: fix building projects with "&|<>" in directory names
11281137
* dparser:
11291138
- add semantic coloring for module and package names
11301139
* mago:
@@ -1135,3 +1144,4 @@ unreleased Version 0.50.0
11351144
- demangle D symbol names
11361145
- regression: use of registers in expression was lost at some point
11371146
- show class and message for exceptions that the debugger breaks on
1147+
- fix conditional breakpoints "not supported"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define VERSION_MINOR 50
33
#define VERSION_REVISION 0
44
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 1
5+
#define VERSION_BUILD 2

msbuild/dbuild/CompileD.cs

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public CompileD()
4747
this.switchOrderList.Add("PerformSyntaxCheckOnly");
4848

4949
this.switchOrderList.Add("BetterC");
50+
this.switchOrderList.Add("CppStandard");
5051
this.switchOrderList.Add("DIP25");
5152
this.switchOrderList.Add("DIP1000");
5253
this.switchOrderList.Add("DIP1008");
@@ -435,37 +436,37 @@ public bool DebugFull
435436
}
436437
}
437438

438-
public string DebugMixin
439-
{
440-
get { return GetStringProperty("DebugMixin"); }
441-
set
442-
{
443-
SetFileProperty("DebugMixin", "Debug Mixin File",
444-
"Expand and save mixins to specified file. (-mixin=[file])",
445-
"-mixin=", value);
446-
}
447-
}
448-
449-
public string CPUArchitecture
450-
{
451-
get { return GetStringProperty("CPUArchitecture"); }
452-
set
453-
{
454-
string[][] switchMap = new string[4][]
455-
{
456-
new string[2] { "baseline", "" },
457-
new string[2] { "avx", "-mcpu=avx" },
458-
new string[2] { "avx2", "-mcpu=avx2" },
459-
new string[2] { "native", "-mcpu=native" }
460-
};
461-
462-
SetEnumProperty("CPUArchitecture", "CPU Architecture",
463-
"generate instructions for architecture. (-mcpu=)",
464-
switchMap, value);
465-
}
466-
}
467-
468-
public string BoundsCheck
439+
public string DebugMixin
440+
{
441+
get { return GetStringProperty("DebugMixin"); }
442+
set
443+
{
444+
SetFileProperty("DebugMixin", "Debug Mixin File",
445+
"Expand and save mixins to specified file. (-mixin=[file])",
446+
"-mixin=", value);
447+
}
448+
}
449+
450+
public string CPUArchitecture
451+
{
452+
get { return GetStringProperty("CPUArchitecture"); }
453+
set
454+
{
455+
string[][] switchMap = new string[4][]
456+
{
457+
new string[2] { "baseline", "" },
458+
new string[2] { "avx", "-mcpu=avx" },
459+
new string[2] { "avx2", "-mcpu=avx2" },
460+
new string[2] { "native", "-mcpu=native" }
461+
};
462+
463+
SetEnumProperty("CPUArchitecture", "CPU Architecture",
464+
"generate instructions for architecture. (-mcpu=)",
465+
switchMap, value);
466+
}
467+
}
468+
469+
public string BoundsCheck
469470
{
470471
get { return GetStringProperty("BoundsCheck"); }
471472
set
@@ -627,6 +628,27 @@ public bool TransitionComplex
627628
}
628629
}
629630

631+
public string CppStandard
632+
{
633+
get { return GetStringProperty("CppStandard"); }
634+
set
635+
{
636+
string[][] switchMap = new string[5][]
637+
{
638+
new string[2] { "default", "" },
639+
new string[2] { "cpp98", "-extern-std=c++98" },
640+
new string[2] { "cpp11", "-extern-std=c++11" },
641+
new string[2] { "cpp14", "-extern-std=c++14" },
642+
new string[2] { "cpp17", "-extern-std=c++17" }
643+
};
644+
645+
SetEnumProperty("CppStandard", "C++ Language Standard",
646+
"set C++ name mangling compatibility (-extern-std=)",
647+
switchMap, value);
648+
}
649+
}
650+
651+
630652
// Messages
631653
public string Warnings
632654
{

msbuild/dcompile.targets

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,20 @@
4646
</DCompile>
4747
</ItemGroup>
4848

49+
<!-- clear mixin file if disabled -->
50+
<ItemGroup>
51+
<DCompile Condition="'%(DCompile.EnableDebugMixin)' != 'true'">
52+
<DebugMixin></DebugMixin>
53+
</DCompile>
54+
</ItemGroup>
55+
4956
<ItemGroup>
5057
<DCompile Condition="'%(DCompile.ObjectFileName)' == '' and '%(DCompile.CompilationModel)' == 'Project'">
5158
<ObjectFileName>$(IntDir)dcompile_$(ProjectName).obj</ObjectFileName>
5259
</DCompile>
60+
<DCompile Condition="'%(DCompile.EnableDebugMixin)' == 'true' and '%(DCompile.DebugMixin)' == '' and '%(DCompile.CompilationModel)' == 'Project'">
61+
<DebugMixin>$(IntDir)dcompile_$(ProjectName).mixin</DebugMixin>
62+
</DCompile>
5363
<DCompile Condition="'%(DCompile.CompilationModel)' == 'Project' and '$(VisualStudioVersion)' != '12.0'">
5464
<UseMultiToolTask>false</UseMultiToolTask> <!-- Never use MultiToolTask when compiling by project -->
5565
</DCompile>
@@ -59,6 +69,9 @@
5969
<DCompile Condition="'%(DCompile.ObjectFileName)' == '' and '%(DCompile.CompilationModel)' == 'Package'">
6070
<ObjectFileName>$(IntDir)dpackage_%(PackageName).obj</ObjectFileName>
6171
</DCompile>
72+
<DCompile Condition="'%(DCompile.EnableDebugMixin)' == 'true' and '%(DCompile.DebugMixin)' == '' and '%(DCompile.CompilationModel)' == 'Package'">
73+
<DebugMixin>$(IntDir)dpackage_%(PackageName).mixin</DebugMixin>
74+
</DCompile>
6275
<DCompile Condition="'%(DCompile.CompilationModel)' == 'Package' and '$(VisualStudioVersion)' != '12.0'">
6376
<UseMultiToolTask>$(CompileD_UseMultiToolTask)</UseMultiToolTask>
6477
</DCompile>
@@ -69,6 +82,10 @@
6982
<ObjectFileName Condition="'%(PackageName)' == ''">$(IntDir)%(FileName).obj</ObjectFileName>
7083
<ObjectFileName Condition="'%(PackageName)' != ''">$(IntDir)%(PackageName).%(FileName).obj</ObjectFileName>
7184
</DCompile>
85+
<DCompile Condition="'%(DCompile.EnableDebugMixin)' == 'true' and '%(DCompile.DebugMixin)' == '' and '%(DCompile.CompilationModel)' == 'File'">
86+
<DebugMixin Condition="'%(PackageName)' == ''">$(IntDir)%(FileName).mixin</DebugMixin>
87+
<DebugMixin Condition="'%(PackageName)' != ''">$(IntDir)%(PackageName).%(FileName).mixin</DebugMixin>
88+
</DCompile>
7289
<DCompile Condition="'%(DCompile.CompilationModel)' == 'File'">
7390
<UseMultiToolTask>$(CompileD_UseMultiToolTask)</UseMultiToolTask>
7491
</DCompile>
@@ -78,6 +95,7 @@
7895
<ItemGroup>
7996
<DCompile>
8097
<ObjectFileName>$([System.String]::Copy('%(ObjectFileName)').Replace('[PackageName]','%(PackageName)'))</ObjectFileName>
98+
<DebugMixin>$([System.String]::Copy('%(DebugMixin)').Replace('[PackageName]','%(PackageName)'))</DebugMixin>
8199
</DCompile>
82100
</ItemGroup>
83101

@@ -107,7 +125,17 @@
107125
<_DebugFull Condition="'$(_DebugFull)' == ''">@(DCompile->Metadata('DebugFull')->Distinct())</_DebugFull>
108126
<_DebugFull Condition="'$(_DebugFull)' != 'true' and '$(_DebugFull)' != 'false'">false</_DebugFull>
109127
</PropertyGroup>
110-
128+
129+
<PropertyGroup>
130+
<_CppStandard Condition="'$(_CppStandard)' == ''">@(DCompile->Metadata('CppStandard')->Distinct())</_CppStandard>
131+
<_clLanguage Condition="'$(_CppStandard)' == 'fromCpp'">@(ClCompile->Metadata('LanguageStandard')->Distinct())</_clLanguage>
132+
<_CppStandard Condition="'$(_CppStandard)' == 'fromCpp' and '$(_clLanguage)' == 'stdcpp14'">cpp14</_CppStandard>
133+
<_CppStandard Condition="'$(_CppStandard)' == 'fromCpp' and '$(_clLanguage)' == 'stdcpp17'">cpp17</_CppStandard>
134+
<_CppStandard Condition="'$(_CppStandard)' == 'fromCpp' and '$(_clLanguage)' == 'stdcpplatest'">cpp17</_CppStandard>
135+
<_CppStandard Condition="'$(_CppStandard)' == 'fromCpp' and '$(_clLanguage)' == 'Default'">cpp17</_CppStandard>
136+
<_CppStandard Condition="'$(_CppStandard)' == 'fromCpp'">default</_CppStandard> <!-- for older VS -->
137+
</PropertyGroup>
138+
111139
<PropertyGroup>
112140
<ClMultiToolTaskMinimalRebuild>true</ClMultiToolTaskMinimalRebuild>
113141
<ClMultiToolTaskMinimalRebuild Condition="'$(_BuildActionType)' != 'Build' or '$(ForceRebuild)' == 'true'">false</ClMultiToolTaskMinimalRebuild>
@@ -172,6 +200,7 @@
172200
PerformSyntaxCheckOnly="%(DCompile.PerformSyntaxCheckOnly)"
173201

174202
BetterC="%(DCompile.BetterC)"
203+
CppStandard="$(_CppStandard)"
175204
DIP25="%(DCompile.DIP25)"
176205
DIP1000="%(DCompile.DIP1000)"
177206
DIP1008="%(DCompile.DIP1008)"

msbuild/dcompile_defaults.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<StackStomp>false</StackStomp>
5757
<AllInst>false</AllInst>
5858
<BetterC>false</BetterC>
59+
<CppStandard>default</CppStandard>
5960
<DIP25>false</DIP25>
6061
<DIP1000>false</DIP1000>
6162
<DIP1008>false</DIP1008>
@@ -83,6 +84,7 @@
8384
<AdditionalOptions></AdditionalOptions>
8485
<CompilationModel>Project</CompilationModel>
8586
<CRuntimeLibrary>MultiThreaded</CRuntimeLibrary>
87+
<EnableDebugMixin>false</EnableDebugMixin>
8688
<!-- do not provide empty strings as default, they will show up on the generated command line
8789
<ObjectFileName></ObjectFileName>
8890
<DocDir></DocDir>

msbuild/dmd.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@
126126
<BoolProperty Name="Main" Category="Code Generation" DisplayName="Add Main" Switch="-main"
127127
Description="add default main() (e.g. for unittesting)." />
128128
<EnumProperty Name="BoundsCheck" Category="Code Generation" DisplayName="Bounds Checking" Description="enable array bounds checking.">
129-
<EnumValue Name="Default" DisplayName="asserts, invariants, contraints" />
130-
<EnumValue Name="Debug" DisplayName="debug statements, asserts, invariants, contraints" Switch="-debug" />
131-
<EnumValue Name="Release" DisplayName="none" Switch="-release" />
129+
<EnumValue Name="Off" DisplayName="None" Switch="-boundscheck=off" />
130+
<EnumValue Name="SafeOnly" DisplayName="For @safe code" Switch="-boundscheck=safeonly" />
131+
<EnumValue Name="On" DisplayName="Always" Switch="-boundscheck=on" />
132132
</EnumProperty>
133133
<EnumProperty Name="CPUArchitecture" Category="Code Generation" DisplayName="CPU Architecture" Description="generate instructions for architecture.">
134134
<EnumValue Name="baseline" DisplayName="default architecture as determined by target" Switch="-mcpu=baseline" />
@@ -149,13 +149,24 @@
149149
</EnumProperty>
150150
<BoolProperty Name="DebugFull" Category="Code Generation" DisplayName="Full Debug Info" Switch="-gf"
151151
Description="when generating debug info emit it for all referenced types." />
152-
<BoolProperty Name="DebugMixin" Category="Code Generation" DisplayName="Mixin Debug File" Switch="-mixin="
152+
<BoolProperty Name="EnableDebugMixin" Category="Code Generation" DisplayName="Enable Mixin Debugging"
153153
Description="expand and save mixins to specified file. (dmd 2.084.1)" />
154+
<StringProperty Name="DebugMixin" Category="Code Generation" DisplayName="Mixin Debug File" Switch="-mixin="
155+
Description="Specifies the name of the mixin debug file if mixin debugging is enabled. Leave empty to auto generate a name according to the compilation model. Use [PackageName] to add the folder name with special characters replaced." />
154156

155157
<BoolProperty Name="PerformSyntaxCheckOnly" Category="Code Generation" DisplayName="Perform Syntax Check Only"
156158
Description="Performs a syntax check only." Switch="-o-" />
157159

158160
<!-- =============== Language =============== -->
161+
<EnumProperty Name="CppStandard" Category="Language" DisplayName="C++ Language Standard"
162+
Description="set C++ name mangling compatibility. (dmd 2.085+)">
163+
<EnumValue Name="default" DisplayName="Default" />
164+
<EnumValue Name="cpp98" DisplayName="C++ 98" Switch="-extern-std=c++98" />
165+
<EnumValue Name="cpp11" DisplayName="C++ 11" Switch="-extern-std=c++11" />
166+
<EnumValue Name="cpp14" DisplayName="C++ 14" Switch="-extern-std=c++14" />
167+
<EnumValue Name="cpp17" DisplayName="C++ 17" Switch="-extern-std=c++17" />
168+
<EnumValue Name="fromCpp" DisplayName="Match Visual C++ Setting" Switch="-extern-std=c++17" />
169+
</EnumProperty>
159170
<BoolProperty Name="BetterC" Category="Language" DisplayName="Better C" Switch="-betterC"
160171
Description="omit generating some runtime information and helper functions." />
161172
<BoolProperty Name="DIP25" Category="Language" DisplayName="DIP25" Switch="-dip25"

msbuild/ldc.xml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@
124124
Description="generate code for all template instantiations." Switch="-allinst" />
125125
<BoolProperty Name="Main" Category="Code Generation" DisplayName="Add Main" Switch="-main"
126126
Description="add default main() (e.g. for unittesting)." />
127-
127+
<EnumProperty Name="BoundsCheck" Category="Code Generation" DisplayName="Bounds Checking" Description="enable array bounds checking.">
128+
<EnumValue Name="Off" DisplayName="None" Switch="-boundscheck=off" />
129+
<EnumValue Name="SafeOnly" DisplayName="For @safe code" Switch="-boundscheck=safeonly" />
130+
<EnumValue Name="On" DisplayName="Always" Switch="-boundscheck=on" />
131+
</EnumProperty>
132+
128133
<EnumProperty Name="DebugCode" Category="Code Generation" DisplayName="Debug Code" Description="compile in debug code.">
129134
<EnumValue Name="Default" DisplayName="asserts, invariants, contraints" />
130135
<EnumValue Name="Debug" DisplayName="debug statements, asserts, invariants, contraints" Switch="-debug" />
@@ -135,16 +140,24 @@
135140
<EnumValue Name="VS" DisplayName="For VS debug engines" Switch="-gc" />
136141
<EnumValue Name="Mago" DisplayName="For D debug engines (mago)" Switch="-g" />
137142
</EnumProperty>
138-
<EnumProperty Name="BoundsCheck" Category="Code Generation" DisplayName="Bounds Checking" Description="enable array bounds checking.">
139-
<EnumValue Name="Off" DisplayName="None" Switch="-boundscheck=off" />
140-
<EnumValue Name="SafeOnly" DisplayName="For @safe code" Switch="-boundscheck=safeonly" />
141-
<EnumValue Name="On" DisplayName="Always" Switch="-boundscheck=on" />
142-
</EnumProperty>
143+
<BoolProperty Name="EnableDebugMixin" Category="Code Generation" DisplayName="Enable Mixin Debugging"
144+
Description="expand and save mixins to specified file." />
145+
<StringProperty Name="DebugMixin" Category="Code Generation" DisplayName="Mixin Debug File" Switch="-mixin="
146+
Description="Specifies the name of the mixin debug file if mixin debugging is enabled. Leave empty to auto generate a name according to the compilation model. Use [PackageName] to add the folder name with special characters replaced." />
143147

144148
<BoolProperty Name="PerformSyntaxCheckOnly" Category="Code Generation" DisplayName="Perform Syntax Check Only"
145149
Description="Performs a syntax check only." Switch="-o-" />
146150

147151
<!-- =============== Language =============== -->
152+
<EnumProperty Name="CppStandard" Category="Language" DisplayName="C++ Language Standard"
153+
Description="set C++ name mangling compatibility. (LDC 1.15.0+)">
154+
<EnumValue Name="default" DisplayName="Default" />
155+
<EnumValue Name="cpp98" DisplayName="C++ 98" Switch="-extern-std=c++98" />
156+
<EnumValue Name="cpp11" DisplayName="C++ 11" Switch="-extern-std=c++11" />
157+
<EnumValue Name="cpp14" DisplayName="C++ 14" Switch="-extern-std=c++14" />
158+
<EnumValue Name="cpp17" DisplayName="C++ 17" Switch="-extern-std=c++17" />
159+
<EnumValue Name="fromCpp" DisplayName="Match Visual C++ Setting" Switch="-extern-std=c++17" />
160+
</EnumProperty>
148161
<BoolProperty Name="BetterC" Category="Language" DisplayName="Better C" Switch="-betterC"
149162
Description="omit generating some runtime information and helper functions." />
150163
<BoolProperty Name="DIP25" Category="Language" DisplayName="DIP25" Switch="-dip25"

stdext/path.d

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ string quoteFilename(string fname)
117117
{
118118
if(fname.length >= 2 && fname[0] == '\"' && fname[$-1] == '\"')
119119
return fname;
120-
if(fname.indexOf('$') >= 0 || indexOf(fname, ' ') >= 0)
120+
if(fname.indexOfAny("$ &|<>") >= 0)
121121
fname = "\"" ~ fname ~ "\"";
122122
return fname;
123123
}
@@ -135,6 +135,14 @@ string quoteNormalizeFilename(string fname)
135135
return quoteFilename(normalizePath(fname));
136136
}
137137

138+
string quoteFilenameForCmd(string cmdfile)
139+
{
140+
string qcmdfile = quoteFilename(cmdfile);
141+
if (qcmdfile.length > 2 && qcmdfile[0] == '"')
142+
qcmdfile = qcmdfile[1..2] ~ "\"" ~ qcmdfile[2..$]; // trick cmd into not removing quotes (e.g. fails with '&' in name)
143+
return qcmdfile;
144+
}
145+
138146
string getNameWithoutExt(string fname)
139147
{
140148
string bname = baseName(fname);

0 commit comments

Comments
 (0)