Skip to content

Commit 3f2b9e7

Browse files
authored
Merge pull request #114 from rainers/master
Visual D 0.50.0-beta3
2 parents 6f0e245 + 0c5511a commit 3f2b9e7

File tree

12 files changed

+94
-18
lines changed

12 files changed

+94
-18
lines changed

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 2
5+
#define VERSION_BUILD 3

msbuild/dbuild/CompileD.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public CompileD()
3838
this.switchOrderList.Add("StackStomp");
3939
this.switchOrderList.Add("AllInst");
4040
this.switchOrderList.Add("Main");
41+
this.switchOrderList.Add("LowMem");
4142
this.switchOrderList.Add("DebugCode");
4243
this.switchOrderList.Add("DebugInfo");
4344
this.switchOrderList.Add("DebugFull");
@@ -389,6 +390,17 @@ public bool Main
389390
}
390391
}
391392

393+
public bool LowMem
394+
{
395+
get { return GetBoolProperty("LowMem"); }
396+
set
397+
{
398+
SetBoolProperty("LowMem", "Low Memory Usage",
399+
"Use garbage collector to reduce memory needed by the compiler (-lowmem)",
400+
"-lowmem", value);
401+
}
402+
}
403+
392404
public string DebugCode
393405
{
394406
get { return GetStringProperty("DebugCode"); }
@@ -1033,6 +1045,24 @@ public string GenCmdLine(Dictionary<string, object> parameters)
10331045
return GenerateCommandLineExceptSwitches(new string[0]);
10341046
}
10351047

1048+
#if TOOLS_V14 || TOOLS_V15
1049+
protected override string GenerateCommandLineCommandsExceptSwitches(string[] switchesToRemove, VCToolTask.CommandLineFormat format = VCToolTask.CommandLineFormat.ForBuildLog, VCToolTask.EscapeFormat escapeFormat = VCToolTask.EscapeFormat.Default)
1050+
{
1051+
string cmd = base.GenerateCommandLineCommandsExceptSwitches(switchesToRemove, format, escapeFormat);
1052+
#else
1053+
protected override string GenerateCommandLineCommands(VCToolTask.CommandLineFormat format = VCToolTask.CommandLineFormat.ForBuildLog)
1054+
{
1055+
string cmd = base.GenerateCommandLineCommands(format);
1056+
#endif
1057+
// must be outside of response file
1058+
if (LowMem)
1059+
if (string.IsNullOrEmpty(cmd))
1060+
cmd = " -lowmem";
1061+
else
1062+
cmd += " -lowmem"; // must be outside of response file
1063+
return cmd;
1064+
}
1065+
10361066
public override bool Execute()
10371067
{
10381068
if (!String.IsNullOrEmpty(TrackerLogDirectory))

msbuild/dcompile.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
ShowGC="%(DCompile.ShowGC)"
222222
IgnorePragma="%(DCompile.IgnorePragma)"
223223
ShowDependencies="%(DCompile.ShowDependencies)"
224+
LowMem="%(DCompile.LowMem)"
224225

225226
DocDir="%(DCompile.DocDir)"
226227
DocFile="%(DCompile.DocFile)"

msbuild/dcompile_defaults.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<PerformSyntaxCheckOnly>false</PerformSyntaxCheckOnly>
7777
<PreserveSourcePath>false</PreserveSourcePath>
7878
<Main>false</Main>
79+
<LowMem>false</LowMem>
7980
<ShowDependencies>false</ShowDependencies>
8081
<VersionIdentifiers></VersionIdentifiers>
8182
<DebugIdentifiers></DebugIdentifiers>

msbuild/dmd.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
<DataSource Persistence="ProjectFile" ItemType="" Label="" HasConfigurationCondition="true" />
6969
</BoolProperty.DataSource>
7070
</BoolProperty>
71-
71+
<BoolProperty Name="LowMem" Category="General" DisplayName="Enable garbage collection for the compiler"
72+
Description="Uses less memory for the compilation at the cost of slower compilation. (-lowmem)" Switch="-lowmem" />
7273

7374
<!-- =============== Messages =============== -->
7475
<EnumProperty Name="Warnings" Category="Messages" DisplayName="Enable warnings" Description="Enable display of warnings. (-w, -wi)">

msbuild/ldc.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
<DataSource Persistence="ProjectFile" ItemType="" Label="" HasConfigurationCondition="true" />
6969
</BoolProperty.DataSource>
7070
</BoolProperty>
71+
<BoolProperty Name="LowMem" Category="General" DisplayName="Enable garbage collection for the compiler"
72+
Description="Uses less memory for the compilation at the cost of slower compilation. (-lowmem)" Switch="-lowmem" />
7173

7274
<!-- =============== Messages =============== -->
7375
<EnumProperty Name="Warnings" Category="Messages" DisplayName="Enable warnings" Description="Enable display of warnings. (-w, -wi)">

nsis/visuald.nsi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@
9090
Caption "${LONG_APPNAME} ${VERSION} Setup"
9191
!ifdef DMD
9292
!ifdef LDC
93-
!define OUT_SUFFIX "-dmd${DMD_VERSION}-ldc2-${LDC_VERSION}"
93+
!define OUT_SUFFIX "-dmd-${DMD_VERSION}-ldc2-${LDC_VERSION}"
9494
!else
95-
!define OUT_SUFFIX "-dmd${DMD_VERSION}"
95+
!define OUT_SUFFIX "-dmd-${DMD_VERSION}"
9696
!endif
9797
!else
9898
!define OUT_SUFFIX ""
@@ -330,7 +330,7 @@ ${MementoSection} "Install DMD" SecDMD
330330

331331
; not using ${File} to keep compiler even if Visual D uninstalled
332332

333-
!define DmdBaseDir "$CompilerInstallDir\dmd${DMD_VERSION}"
333+
!define DmdBaseDir "$CompilerInstallDir\dmd-${DMD_VERSION}"
334334
${SetOutPath} "${DmdBaseDir}"
335335
File /r ${DMD_SRC}\html
336336
File /r ${DMD_SRC}\samples
@@ -911,6 +911,7 @@ SectionEnd
911911
LangString DESC_SecVS2013 ${LANG_ENGLISH} "Register for usage in Visual Studio 2013."
912912
LangString DESC_SecVS2015 ${LANG_ENGLISH} "Register for usage in Visual Studio 2015."
913913
LangString DESC_SecVS2017 ${LANG_ENGLISH} "Register for usage in Visual Studio 2017."
914+
LangString DESC_SecVS2019 ${LANG_ENGLISH} "Register for usage in Visual Studio 2019."
914915
!ifdef EXPRESS
915916
LangString DESC_SecVCExpress2008 ${LANG_ENGLISH} "Register for usage in Visual C++ Express 2008 (experimental and unusable)."
916917
LangString DESC_SecVCExpress2010 ${LANG_ENGLISH} "Register for usage in Visual C++ Express 2010 (experimental and unusable)."
@@ -946,6 +947,7 @@ SectionEnd
946947
!insertmacro MUI_DESCRIPTION_TEXT ${SecVS2013} $(DESC_SecVS2013)
947948
!insertmacro MUI_DESCRIPTION_TEXT ${SecVS2015} $(DESC_SecVS2015)
948949
!insertmacro MUI_DESCRIPTION_TEXT ${SecVS2017} $(DESC_SecVS2017)
950+
!insertmacro MUI_DESCRIPTION_TEXT ${SecVS2019} $(DESC_SecVS2019)
949951
!ifdef EXPRESS
950952
!insertmacro MUI_DESCRIPTION_TEXT ${SecVCExpress2008} $(DESC_SecVCExpress2008)
951953
!insertmacro MUI_DESCRIPTION_TEXT ${SecVCExpress2008} $(DESC_SecVCExpress2010)
@@ -1281,7 +1283,7 @@ Function DMDInstallPage
12811283
IfErrors 0 HasDInstallationFolder
12821284
ReadRegStr $DInstallDir HKLM "SOFTWARE\D" "Install_Dir"
12831285
IfErrors 0 HasDInstallationFolder
1284-
StrCpy $DInstallDir "c:\D"
1286+
StrCpy $DInstallDir "C:\D"
12851287
HasDInstallationFolder:
12861288
StrCpy $CompilerInstallDir $DInstallDir
12871289
HasCompilerInstallDir:

stdext/string.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ bool _startsWith(string s, string w)
261261
//alias startsWith _startsWith;
262262

263263
// munch deprecated in phobos
264-
char[] _munch(ref char[] s, const(char)[] pattern) @safe pure @nogc
264+
inout(char)[] _munch(ref inout(char)[] s, const(char)[] pattern) @safe pure @nogc
265265
{
266266
size_t j = s.length;
267267
foreach (i, dchar c; s)
@@ -272,12 +272,12 @@ char[] _munch(ref char[] s, const(char)[] pattern) @safe pure @nogc
272272
break;
273273
}
274274
}
275-
char[] head = s[0 .. j];
275+
auto head = s[0 .. j];
276276
s = s[j .. $];
277277
return head;
278278
}
279279

280-
bool parseLong(ref char[] txt, out long res)
280+
bool parseLong(ref const(char)[] txt, out long res)
281281
{
282282
_munch(txt, " \t\n\r");
283283
int n = 0;
@@ -290,13 +290,13 @@ bool parseLong(ref char[] txt, out long res)
290290
return true;
291291
}
292292

293-
char[] parseNonSpace(ref char[] txt)
293+
inout(char)[] parseNonSpace(ref inout(char)[] txt)
294294
{
295295
_munch(txt, " \t\n\r");
296296
int n = 0;
297297
while(n < txt.length && !isWhite(txt[n]))
298298
n++;
299-
char[] res = txt[0..n];
299+
auto res = txt[0..n];
300300
txt = txt[n..$];
301301
return res;
302302
}

visuald/dlangsvc.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class LanguageService : DisposingComObject,
262262
*/
263263
*pbstrName = null;
264264
*piLineOffset = 0;
265-
return S_OK;
265+
return E_FAIL;
266266
}
267267

268268
override HRESULT GetProximityExpressions(IVsTextBuffer pBuffer, in int iLine, in int iCol, in int cLines, IVsEnumBSTR* ppEnum)

visuald/profiler.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,14 +2036,14 @@ class ProfileItemIndex
20362036
}
20372037
else if(curItem)
20382038
{
2039-
char[] txt = buf;
2039+
const(char)[] txt = buf;
20402040
_munch(txt, " \t\n\r");
20412041
if(txt.length > 0 && isDigit(txt[0]))
20422042
{
20432043
long calls;
20442044
if(parseLong(txt, calls))
20452045
{
2046-
char[] id = parseNonSpace(txt);
2046+
auto id = parseNonSpace(txt);
20472047
if(id.length > 0)
20482048
{
20492049
_munch(txt, " \t\n\r");
@@ -2061,7 +2061,7 @@ class ProfileItemIndex
20612061
else if(txt.length > 0)
20622062
{
20632063
long calls, treeTime, funcTime;
2064-
char[] id = parseNonSpace(txt);
2064+
auto id = parseNonSpace(txt);
20652065
if(id.length > 0 &&
20662066
parseLong(txt, calls) &&
20672067
parseLong(txt, treeTime) &&

0 commit comments

Comments
 (0)