Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade frontend & libs to v2.100.0+ #3970

Merged
merged 36 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b7b8e59
Upgrade frontend & libs to v2.100.0-beta.1+ (dlang/dmd@c0cff59c79)
kinke Apr 26, 2022
8b3b566
Adapt lit-test semantic/dcompute.d to obsolete delete keyword
kinke Apr 26, 2022
a3716c0
Initialize new TargetC fields
kinke Apr 26, 2022
597e67c
druntime: Add newly required `return` attribute in rt.sections_android
kinke Apr 26, 2022
c555700
Predefine new version D_Invariants
kinke Apr 26, 2022
926d301
dmd-testsuite: Adapt expected output of fail_compilation/write_error.d
kinke Apr 26, 2022
ab5f33b
dmd-testsuite: Restore mini-adaption of runnable_cxx/extra-files/cppb…
kinke Apr 26, 2022
a755317
dmd-testsuite: Add .gitattributes for strict EOLs from upstream DMD r…
kinke Apr 26, 2022
7888837
dmd-testsuite: Adapt expected output of fail_compilation/write_error.…
kinke Apr 27, 2022
a183154
Optimize placement of LDC-specific Scope::emitInstrumentation field
kinke Apr 28, 2022
e4878f2
codegen: Support EqualExp with non-bool type (for importC AST)
kinke Apr 30, 2022
dab538f
importC: Fix mangling of extern variable inside function
kinke Apr 30, 2022
4b1f551
Pass isCfile parameter for all defaultInit() calls, for some extra im…
kinke Apr 30, 2022
f892dd7
druntime: Define __va_list in importC's __builtins.di
kinke Apr 30, 2022
b3e7fc8
Handle importC SymOffExp quirk
kinke Apr 30, 2022
952e63b
druntime: Add missing symbols in importC's __builtins.di
kinke Apr 30, 2022
be20833
codegen: Support {Not,Logical,Identity,Cmp}Exp with non-bool type (fo…
kinke Apr 30, 2022
523bcdb
dmd-testsuite: Enforce `-defaultlib=` (no druntime/Phobos) for *.c tests
kinke Apr 30, 2022
098c2b0
[add changelog entry]
kinke May 1, 2022
8cbb273
Merge upstream stable (dlang/dmd@84af0a8586)
kinke May 1, 2022
4ca4716
Work around bug with LDC < v1.14 host compilers
kinke May 2, 2022
81d2178
Merge upstream stable (dlang/dmd@de56f38c3c)
kinke May 5, 2022
1fb01cf
Merge upstream stable (dlang/dmd@71512901f7)
kinke May 6, 2022
be9d581
Adapt glue layer to renamed/changed Declaration::linkage
kinke May 6, 2022
3426418
Merge remote-tracking branch 'origin/master' into merge-2.100
kinke May 6, 2022
aa6dfe8
[add lost CMakeLists.txt changes]
kinke May 6, 2022
c63b52a
CMake: Tweak library versioning symlink scheme
kinke May 6, 2022
99c9f6d
Merge upstream stable (dlang/dmd@5233596cf8)
kinke May 12, 2022
4dc0264
Merge remote-tracking branch 'origin/master' into merge-2.100
kinke May 12, 2022
e2ba821
Merge remote-tracking branch 'origin/master' into merge-2.100
kinke May 12, 2022
ea75a5c
Disable lit-test sanitizers/asan_fakestack_GC.d for now
kinke May 12, 2022
f945b2e
[merge fixup]
kinke May 12, 2022
bb5fa60
GH Actions: Work around trivial, weird & sporadic issue on Windows
kinke May 12, 2022
0c5a122
Merge upstream stable (dlang/dmd@a53934d18e)
kinke May 15, 2022
19e0003
Bump bundled dub, dlang tools and reggae to latest versions
kinke May 15, 2022
24f5af4
Bump mimalloc to latest stable version
kinke May 15, 2022
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
2 changes: 1 addition & 1 deletion .github/actions/merge-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ runs:
fi

artifactName="ldc2-$artifactID-windows-multilib"
mv ldc2-multilib $artifactName
cp -R ldc2-multilib $artifactName # copy, not move - sporadic 'permission denied' errors…
7z a -mx=9 newArtifacts/$artifactName.7z $artifactName >/dev/null

# export ARTIFACT_{ID,NAME}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# LDC master

#### Big news
- Frontend, druntime and Phobos are at version [2.100.0](https://dlang.org/changelog/2.100.0.html). (#3970)
- LLVM for prebuilt packages bumped to v14.0.3. (#3952, #3979)
- All LLVM targets are enabled now (=> more targets for cross-compilation).
- For the Mac package, the minimum supported macOS version has been raised to v10.12.
Expand Down
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,12 @@ include(GetLinuxDistribution)
#

# Version information
set(LDC_VERSION "1.29.0") # May be overridden by git hash tag
set(LDC_VERSION "1.30.0") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 0)
set(DMDFE_PATCH_VERSION 99)
set(DMDFE_FIX_LEVEL 1)
set(DMDFE_MINOR_VERSION 100)
set(DMDFE_PATCH_VERSION 0)

set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}${DMDFE_PATCH_VERSION})
if(DEFINED DMDFE_FIX_LEVEL)
set(DMD_VERSION ${DMD_VERSION}.${DMDFE_FIX_LEVEL})
endif()
set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}.${DMDFE_PATCH_VERSION})

# Generally, we want to install everything into CMAKE_INSTALL_PREFIX, but when
# it is /usr, put the config files into /etc to meet common practice.
Expand Down
2 changes: 2 additions & 0 deletions dmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ Note that these groups have no strict meaning, the category assignments are a bi
| [impcnvtab.d](https://github.com/dlang/dmd/blob/master/src/dmd/impcnvtab.d) | Define an implicit conversion table for basic types |
| [importc.d](https://github.com/dlang/dmd/blob/master/src/dmd/importc.d) | Helpers specific to ImportC |
| [sideeffect.d](https://github.com/dlang/dmd/blob/master/src/dmd/sideeffect.d) | Extract side-effects of expressions for certain lowerings. |
| [mustuse.d](https://github.com/dlang/dmd/blob/master/src/dmd/mustuse.d) | Helpers related to the `@mustuse` attribute |


**Compile Time Function Execution (CTFE)**

Expand Down
28 changes: 25 additions & 3 deletions dmd/aggregate.d
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@ enum ClassKind : ubyte
c,
}

/**
* Give a nice string for a class kind for error messages
* Params:
* c = class kind
* Returns:
* 0-terminated string for `c`
*/
const(char)* toChars(ClassKind c)
{
final switch (c)
{
case ClassKind.d:
return "D";
case ClassKind.cpp:
return "C++";
case ClassKind.objc:
return "Objective-C";
case ClassKind.c:
return "C";
}
}

/**
* If an aggregate has a pargma(mangle, ...) this holds the information
* to mangle.
Expand Down Expand Up @@ -234,7 +256,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol

abstract void finalizeSize();

override final d_uns64 size(const ref Loc loc)
override final uinteger_t size(const ref Loc loc)
{
//printf("+AggregateDeclaration::size() %s, scope = %p, sizeok = %d\n", toChars(), _scope, sizeok);
bool ok = determineSize(loc);
Expand Down Expand Up @@ -570,7 +592,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
* definitions exposed some issues in their TypeInfo generation in DMD.
* Related PR: https://github.com/dlang/dmd/pull/13312
*/
if (semanticRun == PASS.init && !isInterfaceDeclaration())
if (semanticRun == PASS.initial && !isInterfaceDeclaration())
{
auto stc = storage_class;
if (_scope)
Expand Down Expand Up @@ -747,7 +769,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
extern (C++) static int fp(Dsymbol s, void* ctxt)
{
auto f = s.isCtorDeclaration();
if (f && f.semanticRun == PASS.init)
if (f && f.semanticRun == PASS.initial)
f.dsymbolSemantic(null);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion dmd/aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class AggregateDeclaration : public ScopeDsymbol
size_t nonHiddenFields();
bool determineSize(const Loc &loc);
virtual void finalizeSize() = 0;
d_uns64 size(const Loc &loc);
uinteger_t size(const Loc &loc);
bool fill(const Loc &loc, Expressions *elements, bool ctorinit);
Type *getType();
bool isDeprecated() const; // is aggregate deprecated?
Expand Down
4 changes: 2 additions & 2 deletions dmd/aliasthis.d
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ Expression resolveAliasThis(Scope* sc, Expression e, bool gag = false, bool find

if (tthis && ad.aliasthis.sym.needThis())
{
if (e.op == EXP.variable)
if (auto ve = e.isVarExp())
{
if (auto fd = (cast(VarExp)e).var.isFuncDeclaration())
if (auto fd = ve.var.isFuncDeclaration())
{
// https://issues.dlang.org/show_bug.cgi?id=13009
// Support better match for the overloaded alias this.
Expand Down
4 changes: 2 additions & 2 deletions dmd/apply.d
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ public:
override void visit(NewExp e)
{
//printf("NewExp::apply(): %s\n", toChars());
doCond(e.thisexp) || doCond(e.newargs) || doCond(e.arguments) || applyTo(e);
doCond(e.thisexp) || doCond(e.arguments) || applyTo(e);
}

override void visit(NewAnonClassExp e)
{
//printf("NewAnonClassExp::apply(): %s\n", toChars());
doCond(e.thisexp) || doCond(e.newargs) || doCond(e.arguments) || applyTo(e);
doCond(e.thisexp) || doCond(e.arguments) || applyTo(e);
}

override void visit(TypeidExp e)
Expand Down
2 changes: 1 addition & 1 deletion dmd/argtypes_x86.d
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ extern (C++) TypeTuple toArgTypes_x86(Type t)
* nfields = number of fields in the aggregate (dimension for static arrays)
* getFieldInfo = get information about the nth field in the aggregate
*/
extern (D) void aggregate(d_uns64 sz, size_t nfields, Type delegate(size_t, out uint, out uint) getFieldInfo)
extern (D) void aggregate(uinteger_t sz, size_t nfields, Type delegate(size_t, out uint, out uint) getFieldInfo)
{
if (nfields == 0)
return memory();
Expand Down
12 changes: 6 additions & 6 deletions dmd/arrayop.d
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ bool isArrayOpValid(Expression e)
{
if (isUnaArrayOp(e.op))
{
return isArrayOpValid((cast(UnaExp)e).e1);
return isArrayOpValid(e.isUnaExp().e1);
}
if (isBinArrayOp(e.op) || isBinAssignArrayOp(e.op) || e.op == EXP.assign)
{
BinExp be = cast(BinExp)e;
BinExp be = e.isBinExp();
return isArrayOpValid(be.e1) && isArrayOpValid(be.e2);
}
if (e.op == EXP.construct)
{
BinExp be = cast(BinExp)e;
BinExp be = e.isBinExp();
return be.e1.op == EXP.slice && isArrayOpValid(be.e2);
}
// if (e.op == EXP.call)
Expand All @@ -76,7 +76,7 @@ bool isArrayOpValid(Expression e)
bool isNonAssignmentArrayOp(Expression e)
{
if (e.op == EXP.slice)
return isNonAssignmentArrayOp((cast(SliceExp)e).e1);
return isNonAssignmentArrayOp(e.isSliceExp().e1);

Type tb = e.type.toBasetype();
if (tb.ty == Tarray || tb.ty == Tsarray)
Expand Down Expand Up @@ -158,7 +158,7 @@ Expression arrayOp(BinExp e, Scope* sc)
/// ditto
Expression arrayOp(BinAssignExp e, Scope* sc)
{
//printf("BinAssignExp.arrayOp() %s\n", toChars());
//printf("BinAssignExp.arrayOp() %s\n", e.toChars());

/* Check that the elements of e1 can be assigned to
*/
Expand All @@ -176,7 +176,7 @@ Expression arrayOp(BinAssignExp e, Scope* sc)
return e.e1.modifiableLvalue(sc, e.e1);
}

return arrayOp(cast(BinExp)e, sc);
return arrayOp(e.isBinExp(), sc);
}

/******************************************
Expand Down
1 change: 0 additions & 1 deletion dmd/arraytypes.d
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ alias TemplateInstances = Array!(TemplateInstance);
alias Ensures = Array!(Ensure);
alias Designators = Array!(Designator);
alias DesigInits = Array!(DesigInit);

1 change: 0 additions & 1 deletion dmd/arraytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ typedef Array<struct Ensure> Ensures;
typedef Array<struct Designator> Designators;

typedef Array<struct DesigInit> DesigInits;

10 changes: 10 additions & 0 deletions dmd/astenums.d
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum Baseok : ubyte

enum MODFlags : int
{
none = 0, // default (mutable)
const_ = 1, // type is const
immutable_ = 4, // type is immutable
shared_ = 2, // type is shared
Expand Down Expand Up @@ -430,3 +431,12 @@ enum PINLINE : ubyte
never, /// never inline
always, /// always inline
}

/// Source file type
enum FileType : ubyte
{
d, /// normal D source file
dhdr, /// D header file (.di)
ddoc, /// Ddoc documentation file (.dd)
c, /// C source file
}
66 changes: 45 additions & 21 deletions dmd/attrib.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import dmd.mtype;
import dmd.objc; // for objc.addSymbols
import dmd.common.outbuffer;
import dmd.root.array; // for each
import dmd.target; // for target.systemLinkage
import dmd.tokens;
import dmd.visitor;

Expand Down Expand Up @@ -247,12 +246,12 @@ extern (C++) class StorageClassDeclaration : AttribDeclaration
*/
if (stc & (STC.auto_ | STC.scope_ | STC.static_ | STC.extern_ | STC.manifest))
scstc &= ~(STC.auto_ | STC.scope_ | STC.static_ | STC.extern_ | STC.manifest);
if (stc & (STC.auto_ | STC.scope_ | STC.static_ | STC.tls | STC.manifest | STC.gshared))
scstc &= ~(STC.auto_ | STC.scope_ | STC.static_ | STC.tls | STC.manifest | STC.gshared);
if (stc & (STC.auto_ | STC.scope_ | STC.static_ | STC.manifest | STC.gshared))
scstc &= ~(STC.auto_ | STC.scope_ | STC.static_ | STC.manifest | STC.gshared);
if (stc & (STC.const_ | STC.immutable_ | STC.manifest))
scstc &= ~(STC.const_ | STC.immutable_ | STC.manifest);
if (stc & (STC.gshared | STC.shared_ | STC.tls))
scstc &= ~(STC.gshared | STC.shared_ | STC.tls);
if (stc & (STC.gshared | STC.shared_))
scstc &= ~(STC.gshared | STC.shared_);
if (stc & (STC.safe | STC.trusted | STC.system))
scstc &= ~(STC.safe | STC.trusted | STC.system);
scstc |= stc;
Expand Down Expand Up @@ -399,7 +398,7 @@ extern (C++) final class LinkDeclaration : AttribDeclaration
{
super(loc, null, decl);
//printf("LinkDeclaration(linkage = %d, decl = %p)\n", linkage, decl);
this.linkage = (linkage == LINK.system) ? target.systemLinkage() : linkage;
this.linkage = linkage;
}

static LinkDeclaration create(const ref Loc loc, LINK p, Dsymbols* decl)
Expand Down Expand Up @@ -1015,7 +1014,7 @@ extern (C++) class ConditionalDeclaration : AttribDeclaration
// Decide if 'then' or 'else' code should be included
override Dsymbols* include(Scope* sc)
{
//printf("ConditionalDeclaration::include(sc = %p) scope = %p\n", sc, scope);
//printf("ConditionalDeclaration::include(sc = %p) scope = %p\n", sc, _scope);

if (errors)
return null;
Expand Down Expand Up @@ -1078,7 +1077,7 @@ extern (C++) final class StaticIfDeclaration : ConditionalDeclaration
*/
override Dsymbols* include(Scope* sc)
{
//printf("StaticIfDeclaration::include(sc = %p) scope = %p\n", sc, scope);
//printf("StaticIfDeclaration::include(sc = %p) scope = %p\n", sc, _scope);

if (errors || onStack)
return null;
Expand Down Expand Up @@ -1517,12 +1516,7 @@ extern (C++) final class UserAttributeDeclaration : AttribDeclaration
if (global.params.cplusplus < CppStdRevision.cpp11)
return;

// Avoid `if` at the call site
if (sym.userAttribDecl is null || sym.userAttribDecl.atts is null)
return;

foreach (exp; *sym.userAttribDecl.atts)
{
foreachUdaNoSemantic(sym, (exp) {
if (isGNUABITag(exp))
{
if (sym.isCPPNamespaceDeclaration() || sym.isNspace())
Expand All @@ -1536,9 +1530,10 @@ extern (C++) final class UserAttributeDeclaration : AttribDeclaration
sym.errors = true;
}
// Only one `@gnuAbiTag` is allowed by semantic2
return;
return 1; // break
}
}
return 0; // continue
});
}
}

Expand All @@ -1565,14 +1560,14 @@ bool isCoreUda(Dsymbol sym, Identifier ident)
/**
* Iterates the UDAs attached to the given symbol.
*
* If `dg` returns `!= 0`, it will stop the iteration and return that
* value, otherwise it will return 0.
*
* Params:
* sym = the symbol to get the UDAs from
* sc = scope to use for semantic analysis of UDAs
* dg = called once for each UDA. If `dg` returns `!= 0`, it will stop the
* iteration and return that value, otherwise it will return `0`.
* dg = called once for each UDA
*
* Returns:
* If `dg` returns `!= 0`, stops the iteration and returns that value.
* Otherwise, returns 0.
*/
int foreachUda(Dsymbol sym, Scope* sc, int delegate(Expression) dg)
{
Expand All @@ -1598,3 +1593,32 @@ int foreachUda(Dsymbol sym, Scope* sc, int delegate(Expression) dg)
});
});
}

/**
* Iterates the UDAs attached to the given symbol, without performing semantic
* analysis.
*
* Use this function instead of `foreachUda` if semantic analysis of `sym` is
* still in progress.
*
* Params:
* sym = the symbol to get the UDAs from
* dg = called once for each UDA
*
* Returns:
* If `dg` returns `!= 0`, stops the iteration and returns that value.
* Otherwise, returns 0.
*/
int foreachUdaNoSemantic(Dsymbol sym, int delegate(Expression) dg)
{
if (sym.userAttribDecl is null || sym.userAttribDecl.atts is null)
return 0;

foreach (exp; *sym.userAttribDecl.atts)
{
if (auto result = dg(exp))
return result;
}

return 0;
}
Loading