diff --git a/CHANGES b/CHANGES index 8247ec32..e4df28c3 100644 --- a/CHANGES +++ b/CHANGES @@ -2,7 +2,7 @@ This is the CHANGES file for visuald, a Visual Studio package providing both project management and language services -Copyright (c) 2010-2013 by Rainer Schuetze, All Rights Reserved +Copyright (c) 2010-2025 by Rainer Schuetze, All Rights Reserved Version history --------------- @@ -1406,3 +1406,11 @@ Version history * mago: fixed showing intellisense information in tool tip while debugging in VS2022 * mago: expression evaluator now resolves identifiers of named enumerator types * full installer now bundled with DMD 2.110.0 and LDC 1.40.0 + +2025-04-20 version 1.4.1-beta1 + * dmdserver: updated to frontend of DMD 2.111.0 + * full installer now bundled with DMD 2.111.0 and LDC 1.40.1 + * updated to build with dmd-2.111 + * mago: fixed display of AA key in expanded view + * issue #291: allow overriding the default compiler executable path in the VC project settings + * issue #296: VC project integration: added support to build for ARM64 with LDC diff --git a/README.md b/README.md index 985f3e3f..4703e9d3 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Copyright (c) 2010-2025 by Rainer Schuetze, All Rights Reserved Visual D aims at providing seamless integration of the D programming language into Visual Studio. -For installer download, more documentation and build instructions, please visit http://rainers.github.io/visuald/visuald/StartPage.html. -Use forum http://forum.dlang.org/group/digitalmars.D.ide for questions and the D bug tracker https://issues.dlang.org/ to report issues. +For installer download, more documentation and build instructions, please visit https://rainers.github.io/visuald/visuald/StartPage.html. +Use forum https://forum.dlang.org/group/ide for questions and the D bug tracker https://github.com/dlang/visuald/issues to report issues. Major Features @@ -22,7 +22,7 @@ Major Features - custom build commands - pre/post custom build steps - automatic dependency generation - - automatic link between dependend projects + - automatic link between dependent projects - new project templates * Integration with VC projects @@ -81,7 +81,7 @@ For more details, see the full text of the license in the file LICENSE_1.0.txt. The installer comes with a number of additional products: - cv2pdb: https://github.com/rainers/cv2pdb by Rainer Schuetze -- mago: http://dsource.org/projects/mago_debugger by Aldo Nunez +- mago: https://github.com/rainers/mago by Aldo Nunez/Rainer Schuetze - DParser: https://github.com/aBothe/D_Parser by Alexander Bothe Installation @@ -113,17 +113,17 @@ In a nutshell: - build project "VisualD" For more information, visit -http://rainers.github.io/visuald/visuald/BuildFromSource.html +https://rainers.github.io/visuald/visuald/BuildFromSource.html More Information ---------------- For more information on installation, a quick tour of Visual D with some screen shots and feedback, please visit the project home for Visual D at -[http://rainers.github.io/visuald/visuald/StartPage.html](http://rainers.github.io/visuald/visuald/StartPage.html). +(https://rainers.github.io/visuald/visuald/StartPage.html). -There's a forum dedicated to IDE discussions (http://forum.dlang.org/group/digitalmars.D.ide), where you can leave your comments and suggestions. -Bug reports can be filed to the [D bugzilla database](https://issues.dlang.org/enter_bug.cgi?product=D) -for Component VisualD. +There's a forum dedicated to IDE discussions (https://forum.dlang.org/group/digitalmars.D.ide), where you can leave your comments and suggestions. +Bug reports can be filed to the [issues](https://github.com/dlang/visuald/issues) +of the repository. Have fun, Rainer Schuetze diff --git a/VERSION b/VERSION index ae2ed67b..1228e30d 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 4 -#define VERSION_REVISION 0 -#define VERSION_BETA -#define VERSION_BUILD 0 +#define VERSION_REVISION 1 +#define VERSION_BETA -beta +#define VERSION_BUILD 1 diff --git a/msbuild/dbuild/CompileDOpt.cs b/msbuild/dbuild/CompileDOpt.cs index 5cba95fe..dc4c6c53 100644 --- a/msbuild/dbuild/CompileDOpt.cs +++ b/msbuild/dbuild/CompileDOpt.cs @@ -161,11 +161,12 @@ public string CodeGeneration get { return GetStringProperty("CodeGeneration"); } set { - string[][] switchMap = new string[3][] + string[][] switchMap = new string[4][] { new string[2] { "32BitsMS-COFF", "-m32mscoff" }, new string[2] { "32Bits", "-m32" }, - new string[2] { "64Bits", "-m64" } + new string[2] { "64Bits", "-m64" }, + new string[2] { "ARM64", "-march=arm64" } }; SetEnumProperty("CodeGeneration", "Code Generation", diff --git a/msbuild/dcompile.targets b/msbuild/dcompile.targets index 7140afc9..50287a7a 100644 --- a/msbuild/dcompile.targets +++ b/msbuild/dcompile.targets @@ -371,6 +371,7 @@ $(LDCInstallDir)\lib32;%(Link.AdditionalLibraryDirectories) $(LDCInstallDir)\lib64;%(Link.AdditionalLibraryDirectories) + $(LDCInstallDir)\libarm64;%(Link.AdditionalLibraryDirectories) $(DRuntimeLibs);$(CRuntimeLibs);%(Link.AdditionalDependencies) diff --git a/msbuild/dcompile_defaults.props b/msbuild/dcompile_defaults.props index 8080adce..a1f62460 100644 --- a/msbuild/dcompile_defaults.props +++ b/msbuild/dcompile_defaults.props @@ -131,7 +131,8 @@ 32BitsMS-COFF 32Bits 64Bits - echo DMD not supported on this platform + ARM64 + echo DMD not supported on this platform exit 1 diff --git a/msbuild/dmd.xml b/msbuild/dmd.xml index 708573fc..ebb2e5d6 100644 --- a/msbuild/dmd.xml +++ b/msbuild/dmd.xml @@ -82,8 +82,10 @@ + - + @@ -237,12 +239,12 @@ Description="write browse information to this JSON file." Switch="-Xf" /> - + diff --git a/msbuild/ldc.xml b/msbuild/ldc.xml index 55625db2..81fb24d9 100644 --- a/msbuild/ldc.xml +++ b/msbuild/ldc.xml @@ -82,8 +82,10 @@ + - + @@ -234,6 +236,7 @@ + diff --git a/nsis/visuald.nsi b/nsis/visuald.nsi index 0a84c8a0..de374fd4 100644 --- a/nsis/visuald.nsi +++ b/nsis/visuald.nsi @@ -29,12 +29,12 @@ ; define DMD source path to include dmd installation ; !define DMD -!define DMD_VERSION "2.110.0" +!define DMD_VERSION "2.111.0" !define DMD_SRC c:\d\dmd-${DMD_VERSION} ; define LDC to include ldc installation ; !define LDC -!define LDC_VERSION "1.40.0" +!define LDC_VERSION "1.40.1" !define LDC_SRC c:\d\ldc2-${LDC_VERSION}-windows-multilib ; define VS2019 to include VS2019 support @@ -387,7 +387,7 @@ ${MementoSection} "Install DMD" SecDMD !define DmdBaseDir "$CompilerInstallDir\dmd-${DMD_VERSION}" ${SetOutPath} "${DmdBaseDir}" File /r ${DMD_SRC}\html - File /r ${DMD_SRC}\samples + ;File /r ${DMD_SRC}\samples File /r ${DMD_SRC}\src File /r ${DMD_SRC}\windows File ${DMD_SRC}\license.txt @@ -745,6 +745,8 @@ ${MementoSectionEnd} !endif !macro RegisterPlatform Vxxx Platform + !define UniqueID ${__LINE__} + IfFileExists '${Vxxx}\Platforms\${Platform}' +1 NoPlatformDir_${UniqueID} ${SetOutPath} "${Vxxx}\Platforms\${Platform}\ImportBefore\Default" ${File} ..\msbuild\ImportBefore\Default\ d.props ${SetOutPath} "${Vxxx}\Platforms\${Platform}\ImportBefore" @@ -754,6 +756,8 @@ ${MementoSectionEnd} ${SetOutPath} "${Vxxx}\Platforms\${Platform}\ImportAfter" ${File} ..\msbuild\ImportAfter\ d.targets ${File} ..\msbuild\ImportAfter\ general_d.targets + NoPlatformDir_${UniqueID}: + !undef UniqueID !macroend !define RegisterPlatform "!insertmacro RegisterPlatform" @@ -792,6 +796,7 @@ ${MementoSection} "MSBuild integration" SecMSBuild StrCmp $1 "" NoVS2022 ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "x64" ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "Win32" + ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "ARM64" ${RegisterIcons} "17.0" !define V170_GENERAL_XML "$1\MsBuild\Microsoft\VC\v170\1033\general.xml" @@ -809,6 +814,7 @@ ${MementoSection} "MSBuild integration" SecMSBuild StrCmp $1 "" NoVS2022_2 ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "x64" ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "Win32" + ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "ARM64" ${RegisterIcons} "17.0" !define V170_GENERAL_XML_2 "$1\MsBuild\Microsoft\VC\v170\1033\general.xml" @@ -826,6 +832,7 @@ ${MementoSection} "MSBuild integration" SecMSBuild StrCmp $1 "" NoVS2022_3 ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "x64" ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "Win32" + ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "ARM64" ${RegisterIcons} "17.0" !define V170_GENERAL_XML_3 "$1\MsBuild\Microsoft\VC\v170\1033\general.xml" @@ -843,6 +850,7 @@ ${MementoSection} "MSBuild integration" SecMSBuild StrCmp $1 "" NoVS2022_4 ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "x64" ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "Win32" + ${RegisterPlatform} "$1\MsBuild\Microsoft\VC\v170" "ARM64" ${RegisterIcons} "17.0" !define V170_GENERAL_XML_4 "$1\MsBuild\Microsoft\VC\v170\1033\general.xml" @@ -859,6 +867,7 @@ ${MementoSection} "MSBuild integration" SecMSBuild StrCmp $1 "" NoVS2022BT ${RegisterPlatform} "$1\Common7\IDE\VC\VCTargets" "x64" ${RegisterPlatform} "$1\Common7\IDE\VC\VCTargets" "Win32" + ${RegisterPlatform} "$1\Common7\IDE\VC\VCTargets" "ARM64" ${RegisterIcons} "17.0" !define V170BT_GENERAL_XML "$1\Common7\IDE\VC\VCTargets\1033\general.xml" diff --git a/stdext/com.d b/stdext/com.d index 438e3a50..eb102249 100644 --- a/stdext/com.d +++ b/stdext/com.d @@ -57,14 +57,6 @@ C newCom(C, T...)(T arguments) if(is(C : ComObject) && T.length > 0) class ComObject : IUnknown { - version(none) - @disable new(size_t size) - { - assert(false); // should not be called because we don't have enough type info - void* p = gc_malloc(size, 1, typeid(ComObject)); // BlkAttr.FINALIZE - return p; - } - extern (Windows): override HRESULT QueryInterface(const IID* riid, void** ppv) { diff --git a/vdc/dmdserver/dmd b/vdc/dmdserver/dmd index 93405b3c..1c76aff5 160000 --- a/vdc/dmdserver/dmd +++ b/vdc/dmdserver/dmd @@ -1 +1 @@ -Subproject commit 93405b3c1abe60272913fd58beeadb8a16adbb45 +Subproject commit 1c76aff562cec901f3fb89e9ae29fcb14c145c4b diff --git a/vdc/dmdserver/dmderrors.d b/vdc/dmdserver/dmderrors.d index 31d1b663..b1e67066 100644 --- a/vdc/dmdserver/dmderrors.d +++ b/vdc/dmdserver/dmderrors.d @@ -31,7 +31,7 @@ private __gshared // under gErrorSync lock private string gLastHeader; private string[] gLastErrorMsgs; // all but first are supplemental - private Loc[] gLastErrorLocs; + private SourceLoc[] gLastErrorLocs; } void flushLastError() @@ -46,7 +46,7 @@ void flushLastError() char[] msg; if (pos < gLastErrorLocs.length) { - Loc loc = gLastErrorLocs[pos]; + auto loc = gLastErrorLocs[pos]; int len = snprintf(buf.ptr, buf.length, "%d,%d,%d,%d:", loc.linnum, loc.charnum - 1, loc.linnum, loc.charnum); msg ~= buf[0..len]; } @@ -57,7 +57,7 @@ void flushLastError() if (i > 0) msg ~= "\a"; - Loc loc = gLastErrorLocs[i]; + auto loc = gLastErrorLocs[i]; if (i == pos) { if (i > 0) @@ -65,7 +65,8 @@ void flushLastError() } else if (loc.filename) { - int len = snprintf(buf.ptr, buf.length, "%s(%d): ", loc.filename, loc.linnum); + auto fn = loc.filename; + int len = snprintf(buf.ptr, buf.length, "%.*s(%d): ", cast(int)fn.length, fn.ptr, loc.linnum); msg ~= buf[0..len]; } msg ~= gLastErrorMsgs[i]; @@ -75,7 +76,7 @@ void flushLastError() size_t otherLocs; foreach (loc; gLastErrorLocs) - if (!loc.filename || _stricmp(loc.filename, gErrorFile) != 0) + if (!loc.filename || icmp(loc.filename, gErrorFile) != 0) otherLocs++; if (otherLocs == gLastErrorLocs.length) @@ -87,8 +88,8 @@ void flushLastError() // prepend the loc inside gErrorFile to the beginning of the error message for (size_t i = 0; i < gLastErrorLocs.length; i++) { - Loc loc = gLastErrorLocs[i]; - if (loc.filename && _stricmp(loc.filename, gErrorFile) == 0) + auto loc = gLastErrorLocs[i]; + if (loc.filename && icmp(loc.filename, gErrorFile) == 0) { gErrorMessages ~= genErrorMessage(i) ~ "\n"; break; @@ -101,7 +102,7 @@ void flushLastError() gLastErrorMsgs.length = 0; } -bool errorPrint(const ref Loc loc, Color headerColor, const(char)* header, +bool errorPrint(const ref SourceLoc loc, Color headerColor, const(char)* header, const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null) nothrow { if (!loc.filename) @@ -109,7 +110,7 @@ bool errorPrint(const ref Loc loc, Color headerColor, const(char)* header, try synchronized(gErrorSync) { - bool other = _stricmp(loc.filename, gErrorFile) != 0; + bool other = icmp(loc.filename, gErrorFile) != 0; while (header && std.ascii.isWhite(*header)) header++; bool supplemental = !header || !*header; diff --git a/vdc/dmdserver/dmdinit.d b/vdc/dmdserver/dmdinit.d index bc04c9de..ba5a27d5 100644 --- a/vdc/dmdserver/dmdinit.d +++ b/vdc/dmdserver/dmdinit.d @@ -54,7 +54,13 @@ enum string[2][] dmdStatics = ["_D3dmd7dmodule6Module11loadStdMathFZ8std_mathCQBsQBrQBm", "Module"], ["_D3dmd7dmodule6Module14loadCoreAtomicFZ11core_atomicCQBzQByQBt", "Module"], - ["_D3dmd4func15FuncDeclaration8genCfuncRPSQBm4root5array__T5ArrayTCQCl5mtype9ParameterZQBcCQDjQy4TypeCQDu10identifier10IdentifiermZ2stCQFb7dsymbol12DsymbolTable", "DsymbolTable"], + // up to 2.110 +// ["_D3dmd4func15FuncDeclaration8genCfuncRPSQBm4root5array__T5ArrayTCQCl5mtype9ParameterZQBcCQDjQy4TypeCQDu10identifier10IdentifiermZ2stCQFb7dsymbol12DsymbolTable", "DsymbolTable"], + // 2.111 +// ["_D3dmd4func15FuncDeclaration8genCfuncRPSQBm4root5array__T5ArrayTCQCl5mtype9ParameterZQBcCQDjQy4TypeCQDu10identifier10IdentifierEQEw8astenums3STCZ2stCQFr7dsymbol12DsymbolTable", "DsymbolTable"], + // 2.111.1 + ["_D3dmd4func15FuncDeclaration8genCfuncFPSQBm4root5array__T5ArrayTCQCl5mtype9ParameterZQBcCQDjQy4TypeCQDu10identifier10IdentifierEQEw8astenums3STCZ2stCQFr7dsymbol12DsymbolTable", "DsymbolTable"], + // 2.091 // ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeSQBr7globals3LocPSQCi6dscope5ScopeZ11visitAArrayMFCQDpQCn10TypeAArrayZ3feqCQEn4func15FuncDeclaration", "FuncDeclaration"], // ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeSQBr7globals3LocPSQCi6dscope5ScopeZ11visitAArrayMFCQDpQCn10TypeAArrayZ4fcmpCQEo4func15FuncDeclaration", "FuncDeclaration"], @@ -70,9 +76,13 @@ enum string[2][] dmdStatics = // ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ4fcmpCQEr4func15FuncDeclaration", "FuncDeclaration"], // ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ5fhashCQEs4func15FuncDeclaration", "FuncDeclaration"], // 2.110 - ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ3feqCQEq4func15FuncDeclaration", "FuncDeclaration"], - ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ4fcmpCQEr4func15FuncDeclaration", "FuncDeclaration"], - ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ5fhashCQEs4func15FuncDeclaration", "FuncDeclaration"], +// ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ3feqCQEq4func15FuncDeclaration", "FuncDeclaration"], +// ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ4fcmpCQEr4func15FuncDeclaration", "FuncDeclaration"], +// ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ5fhashCQEs4func15FuncDeclaration", "FuncDeclaration"], + // 2.111 + ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeSQBr8location3LocPSQCj6dscope5ScopeZ11visitAArrayMFCQDqQCo10TypeAArrayZ3feqCQEo4func15FuncDeclaration", "FuncDeclaration"], + ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeSQBr8location3LocPSQCj6dscope5ScopeZ11visitAArrayMFCQDqQCo10TypeAArrayZ4fcmpCQEp4func15FuncDeclaration", "FuncDeclaration"], + ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeSQBr8location3LocPSQCj6dscope5ScopeZ11visitAArrayMFCQDqQCo10TypeAArrayZ5fhashCQEq4func15FuncDeclaration", "FuncDeclaration"], ["_D3dmd7typesem6dotExpFCQv5mtype4TypePSQBk6dscope5ScopeCQCb10expression10ExpressionCQDdQBc8DotIdExpEQDtQCz10DotExpFlagZ11visitAArrayMFCQFcQEi10TypeAArrayZ8fd_aaLenCQGf4func15FuncDeclaration", "FuncDeclaration"], ["_D3dmd7typesem6dotExpFCQv5mtype4TypePSQBk6dscope5ScopeCQCb10expression10ExpressionCQDdQBc8DotIdExpEQDtQCz10DotExpFlagZ8noMemberMFQEdQDsQDdCQFh10identifier10IdentifieriZ4nesti", "int"], @@ -89,8 +99,10 @@ enum string[2][] dmdStatics = // ["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaKxSQCe7globals3LocZ8countersHSQDfQDeQCvQCmFNbQBwKxQBwZ3Keyk", "countersType"], // 2.103 - ["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaKxSQCe8location3LocZ8countersHSQDgQDfQCwQCnFNbQBxKxQBxZ3Keyk", "countersType"], +// ["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaKxSQCe8location3LocZ8countersHSQDgQDfQCwQCnFNbQBxKxQBxZ3Keyk", "countersType"], ["_D3dmd10identifier10Identifier9newSuffixFNbZ1ik", "size_t"], + // 2.111 + ["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaSQCc8location3LocQuZ8countersHSQDgQDfQCwQCnFNbQBxQBxQCdZ3Keyk", "countersType"], // 2.106 ["_D3dmd7arrayop7arrayOpFCQw10expression6BinExpPSQBt6dscope5ScopeZQByCQCo9dtemplate19TemplateDeclaration", "TemplateDeclaration"], @@ -287,7 +299,7 @@ void dmdSetupParams(const ref Options opts) global.params.obj = false; global.params.useDeprecated = !opts.noDeprecated ? DiagnosticReporting.off : opts.deprecatedInfo ? DiagnosticReporting.inform : DiagnosticReporting.error ; - global.params.warnings = !opts.warnings ? DiagnosticReporting.off + global.params.useWarnings = !opts.warnings ? DiagnosticReporting.off : opts.warnAsError ? DiagnosticReporting.error : DiagnosticReporting.inform; global.params.linkswitches = Strings(); global.params.libfiles = Strings(); @@ -340,7 +352,7 @@ void dmdSetupParams(const ref Options opts) default: break; } } - global.params.versionlevel = opts.versionLevel; + // global.params.versionlevel = opts.versionLevel; auto versionids = new Strings(); foreach(v; opts.versionIds) versionids.push(toStringz(v)); @@ -363,7 +375,7 @@ void dmdSetupParams(const ref Options opts) // always enable for tooltips global.params.ddoc.doOutput = true; - global.params.debuglevel = opts.debugLevel; + // global.params.debuglevel = opts.debugLevel; auto debugids = new Strings(); foreach(d; opts.debugIds) debugids.push(toStringz(d)); @@ -377,7 +389,7 @@ void dmdSetupParams(const ref Options opts) global.path.setDim(0); foreach(i; opts.importDirs) - global.path.push(toStringz(i)); + global.path.push(ImportPathInfo(toStringz(i))); global.filePath.setDim(0); foreach(i; opts.stringImportDirs) diff --git a/vdc/dmdserver/dmdrmem.d b/vdc/dmdserver/dmdrmem.d index d2fed109..e1d728ee 100644 --- a/vdc/dmdserver/dmdrmem.d +++ b/vdc/dmdserver/dmdrmem.d @@ -3,6 +3,10 @@ module dmd.root.rmem; import core.memory : GC; import core.stdc.string : strlen; +__gshared size_t heapleft = 0; +__gshared void* heapp; +__gshared size_t heapTotal = 0; // Total amount of memory allocated using malloc + extern (C++) struct Mem { enum isGCEnabled = true; diff --git a/vdc/dmdserver/dmdserver.visualdproj b/vdc/dmdserver/dmdserver.visualdproj index 32752d28..c01c9f02 100644 --- a/vdc/dmdserver/dmdserver.visualdproj +++ b/vdc/dmdserver/dmdserver.visualdproj @@ -2208,7 +2208,7 @@ 0 0 0 - 0 + 2 0 $(CC) -nologo -c -TP -Idmd\src -Idmd\compiler\src\dmd\backend -Idmd\compiler\src\dmd\tk -Idmd\compiler\src\dmd\root -Idmd\src\vcbuild -DTARGET_WINDOS=1 -FIwarnings.h 1 @@ -2279,6 +2279,12 @@ + + + + + + @@ -2301,6 +2307,16 @@ + + + + + + + + + + @@ -2316,7 +2332,6 @@ - @@ -2329,8 +2344,6 @@ - - @@ -2338,11 +2351,11 @@ + - @@ -2363,7 +2376,6 @@ - @@ -2406,16 +2418,13 @@ - - - - + @@ -2424,12 +2433,10 @@ - - @@ -2441,11 +2448,9 @@ - - @@ -2467,6 +2472,7 @@ if exist "%WindowsSdkDir%\bin\%WindowsSDKVersion%x86\rc.exe" set rc=&q + diff --git a/vdc/dmdserver/semanalysis.d b/vdc/dmdserver/semanalysis.d index dd6afb28..93055729 100644 --- a/vdc/dmdserver/semanalysis.d +++ b/vdc/dmdserver/semanalysis.d @@ -25,6 +25,7 @@ import dmd.semantic2; import dmd.semantic3; import std.algorithm; +import std.path; import std.conv; // debug version = traceGC; @@ -235,17 +236,21 @@ string[] guessImportPaths() { import std.file; + string druntime = std.path.dirName(__FILE_FULL_PATH__) ~ r"\dmd\druntime\src"; + assert(std.file.exists(druntime ~ r"\object.d")); + return [ druntime, r"c:\s\d\dlang\phobos" ]; // must have version matching compiler and runtime + foreach(patch; '0'..'3') { string path = r"c:\D\dmd-" ~ to!string(__VERSION__)[0..1] ~ "." ~ to!string(__VERSION__)[1..$] ~ "." ~ patch; if (std.file.exists(path ~ r"\src\druntime\import\object.d")) - return [ path ~ r"\src\druntime\import", path ~ r"\src\phobos" ]; + return [ druntime, path ~ r"\src\phobos" ]; path ~= "-beta.1"; if (std.file.exists(path ~ r"\src\druntime\import\object.d")) - return [ path ~ r"\src\druntime\import", path ~ r"\src\phobos" ]; + return [ druntime, path ~ r"\src\phobos" ]; path = path[0..$-7] ~ "-rc.1"; if (std.file.exists(path ~ r"\src\druntime\import\object.d")) - return [ path ~ r"\src\druntime\import", path ~ r"\src\phobos" ]; + return [ druntime, path ~ r"\src\phobos" ]; } if (std.file.exists(r"c:\s\d\dlang\druntime\import\object.d")) return [ r"c:\s\d\dlang\druntime\import", r"c:\s\d\dlang\phobos" ]; @@ -346,7 +351,7 @@ void do_unittests() assert_equal(col, expected_col); } - void checkBinaryIsInLocations(string src, Loc[] locs) + void checkBinaryIsInLocations(string src, SourceLoc[] locs) { initErrorMessages(filename); Module parsedModule = createModuleFromText(filename, src); @@ -456,7 +461,7 @@ void do_unittests() checkTip(m, 7, 11, "(local variable) `int xyz`"); checkDefinition(m, 7, 11, "source.d", 5, 8); // xyz - checkDefinition(m, 2, 14, opts.importDirs[1] ~ r"\std\stdio.d", 0, 0); // std.stdio + checkDefinition(m, 2, 14, opts.importDirs[1] ~ r"\std\stdio.d", 0, 1); // std.stdio //checkTypeIdentifiers(source); @@ -491,9 +496,9 @@ void do_unittests() return cpu_vendor ~ " " ~ processor; } }; - checkBinaryIsInLocations(source, [Loc(null, 6, 17), Loc(null, 7, 23), - Loc(null, 10, 25), Loc(null, 11, 26), - Loc(null, 15, 18), Loc(null, 17, 15)]); + checkBinaryIsInLocations(source, [SourceLoc(null, 6, 17), SourceLoc(null, 7, 23), + SourceLoc(null, 10, 25), SourceLoc(null, 11, 26), + SourceLoc(null, 15, 18), SourceLoc(null, 17, 15)]); m = checkErrors(source, ""); @@ -784,7 +789,7 @@ void do_unittests() return f10063(p); } }; - m = checkErrors(source, "8,16,8,17:Error: cannot implicitly convert expression `f10063(cast(inout(void*))p)` of type `inout(void)*` to `immutable(void)*`\n"); + m = checkErrors(source, "8,16,8,17:Error: return value `f10063(cast(inout(void*))p)` of type `inout(void)*` does not match return type `immutable(void)*`, and cannot be implicitly converted\n"); checkExpansions(m, 8, 11, "f1", [ "f10063" ]); source = diff --git a/vdc/dmdserver/semvisitor.d b/vdc/dmdserver/semvisitor.d index 4bef292a..317dbcb8 100644 --- a/vdc/dmdserver/semvisitor.d +++ b/vdc/dmdserver/semvisitor.d @@ -42,8 +42,7 @@ import dmd.init; import dmd.location; import dmd.mtype; import dmd.objc; -import dmd.postordervisitor; -import dmd.sapply; +import dmd.visitor.postorder; import dmd.semantic2; import dmd.semantic3; import dmd.statement; @@ -507,8 +506,8 @@ extern(C++) class ASTVisitor : StoppableVisitor override void visit(ForeachRangeStatement stmt) { - if (!stop && stmt.prm) - stmt.prm.accept(this); + if (!stop && stmt.param) + stmt.param.accept(this); visitExpression(stmt.lwr); visitExpression(stmt.upr); visit(cast(Statement)stmt); @@ -2460,8 +2459,8 @@ void addSymbolProperties(ref string[] expansions, RootObject sym, Type t, string : t.isTypeSArray() && hasThis ? staticArrayProps : t.isTypeAArray() && hasThis ? assocArrayProps : t.isTypeDArray() && hasThis ? dynArrayProps - : t.isfloating() ? floatingProps - : t.isintegral() ? integerProps + : t.isFloating() ? floatingProps + : t.isIntegral() ? integerProps : genericProps; foreach (id, p; props) if (id.startsWith(tok)) @@ -2864,7 +2863,8 @@ Module cloneModule(Module mo) { if (!mo) return null; - Module m = new Module(mo.srcfile.toString(), mo.ident, cast(bool)mo.docfile, cast(bool)mo.hdrfile); + Loc mloc = Loc.singleFilename(mo.srcfile.toString()); + Module m = new Module(mloc, mo.srcfile.toString(), mo.ident, cast(bool)mo.docfile, cast(bool)mo.hdrfile); *cast(FileName*)&(m.srcfile) = mo.srcfile; // keep identical source file name pointer m.isPackageFile = mo.isPackageFile; m.md = mo.md; @@ -2885,23 +2885,23 @@ Module cloneModule(Module mo) override void visit(ConditionalStatement cond) { if (auto dbg = cond.condition.isDebugCondition()) - cond.condition = new DebugCondition(dbg.loc, m, dbg.level, dbg.ident); + cond.condition = new DebugCondition(dbg.loc, m, dbg.ident); else if (auto ver = cond.condition.isVersionCondition()) - cond.condition = new VersionCondition(ver.loc, m, ver.level, ver.ident); + cond.condition = new VersionCondition(ver.loc, m, ver.ident); super.visit(cond); } override void visit(ConditionalDeclaration cond) { if (auto dbg = cond.condition.isDebugCondition()) - cond.condition = new DebugCondition(dbg.loc, m, dbg.level, dbg.ident); + cond.condition = new DebugCondition(dbg.loc, m, dbg.ident); else if (auto ver = cond.condition.isVersionCondition()) - cond.condition = new VersionCondition(ver.loc, m, ver.level, ver.ident); + cond.condition = new VersionCondition(ver.loc, m, ver.ident); super.visit(cond); } } - import dmd.permissivevisitor; + import dmd.visitor.permissive; scope v = new AdjustModuleVisitor(m); m.accept(v); return m; @@ -2914,7 +2914,8 @@ Module createModuleFromText(string filename, string text) text ~= "\0\0\0\0"; // parser needs 4 trailing zeroes string name = stripExtension(baseName(filename)); auto id = Identifier.idPool(name); - auto mod = new Module(filename, id, true, false); + Loc mloc = Loc.singleFilename(filename); + auto mod = new Module(mloc, filename, id, true, false); mod.src = cast(ubyte[])text; mod.read(Loc.initial); mod.importedFrom = mod; // avoid skipping unittests diff --git a/vdc/lexer.d b/vdc/lexer.d index c8867f33..9af9f1b4 100644 --- a/vdc/lexer.d +++ b/vdc/lexer.d @@ -1063,8 +1063,15 @@ const string[] keywords = "__FILE__", "__LINE__", "__FUNCTION__", + "__FILE_FULL_PATH__", "__PRETTY_FUNCTION__", "__MODULE__", + "__DATE__", + "__TIME__", + "__TIMESTAMP__", + "__VENDOR__", + "__VERSION__", + "__EOF__", "shared", "immutable", diff --git a/visuald/dlangsvc.d b/visuald/dlangsvc.d index c8aca495..ee3e4244 100644 --- a/visuald/dlangsvc.d +++ b/visuald/dlangsvc.d @@ -5236,10 +5236,10 @@ version(unittest) return E_FAIL; if (iStartIndex > text[iStartLine].length) return E_FAIL; - int endLine = iEndLine < 0 ? text.length - 1 : iEndLine; + int endLine = iEndLine < 0 ? cast(int) text.length - 1 : iEndLine; if (endLine >= text.length) return E_FAIL; - int endIndex = iEndIndex < 0 ? text[endLine].length : iEndIndex; + int endIndex = iEndIndex < 0 ? cast(int) text[endLine].length : iEndIndex; if (endIndex > text[endLine].length) return E_FAIL; @@ -5262,14 +5262,14 @@ version(unittest) HRESULT GetLineCount (/+[out]+/ int *piLines) { - *piLines = text.length; + *piLines = cast(int) text.length; return S_OK; }; HRESULT GetLastLineIndex (/+[out]+/ int *piLine, /+[out]+/ int *piIndex) { - *piLine = text.length - 1; - *piIndex = text.length > 0 ? text[$-1].length : -1; + *piLine = cast(int) text.length - 1; + *piIndex = text.length > 0 ? cast(int) text[$-1].length : -1; return S_OK; }; HRESULT GetLengthOfLine (const int iLine, @@ -5277,7 +5277,7 @@ version(unittest) { if (iLine >= text.length) return E_FAIL; - *piLength = text[iLine].length; + *piLength = cast(int) text[iLine].length; return S_OK; } @@ -5310,7 +5310,7 @@ version(unittest) TextLines textLines = newCom!TextLines(); textLines.text = splitLines(txt); Source src = newCom!Source(textLines); - int lines = textLines.text.length; + int lines = cast(int) textLines.text.length; FormatOptions fmtOpt; fmtOpt.tabSize = 4; diff --git a/visuald_vs10.sln b/visuald_vs10.sln index 23ae00d8..675c5b73 100644 --- a/visuald_vs10.sln +++ b/visuald_vs10.sln @@ -392,7 +392,8 @@ Global {7610F45A-69D9-4B68-BE63-0E055B51D447}.Test|x64.ActiveCfg = Release|Win32 {7610F45A-69D9-4B68-BE63-0E055B51D447}.TestDebug|Win32.ActiveCfg = TestDebug|Win32 {7610F45A-69D9-4B68-BE63-0E055B51D447}.TestDebug|Win32.Build.0 = TestDebug|Win32 - {7610F45A-69D9-4B68-BE63-0E055B51D447}.TestDebug|x64.ActiveCfg = TestDebug|Win32 + {7610F45A-69D9-4B68-BE63-0E055B51D447}.TestDebug|x64.ActiveCfg = TestDebug|x64 + {7610F45A-69D9-4B68-BE63-0E055B51D447}.TestDebug|x64.Build.0 = TestDebug|x64 {32872753-4812-40DA-9B24-1C2114621E78}.Debug COFF32|Win32.ActiveCfg = Debug COFF32|Win32 {32872753-4812-40DA-9B24-1C2114621E78}.Debug COFF32|Win32.Build.0 = Debug COFF32|Win32 {32872753-4812-40DA-9B24-1C2114621E78}.Debug COFF32|x64.ActiveCfg = Debug COFF32|x64 @@ -894,8 +895,8 @@ Global {8EC6179A-7BBA-4555-B384-3B19D3BB7028}.Test|x64.Build.0 = Debug|x64 {8EC6179A-7BBA-4555-B384-3B19D3BB7028}.TestDebug|Win32.ActiveCfg = TestDebug|Win32 {8EC6179A-7BBA-4555-B384-3B19D3BB7028}.TestDebug|Win32.Build.0 = TestDebug|Win32 - {8EC6179A-7BBA-4555-B384-3B19D3BB7028}.TestDebug|x64.ActiveCfg = Debug|x64 - {8EC6179A-7BBA-4555-B384-3B19D3BB7028}.TestDebug|x64.Build.0 = Debug|x64 + {8EC6179A-7BBA-4555-B384-3B19D3BB7028}.TestDebug|x64.ActiveCfg = TestDebug|x64 + {8EC6179A-7BBA-4555-B384-3B19D3BB7028}.TestDebug|x64.Build.0 = TestDebug|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE