Skip to content

Comments

Remove old druntime interface#7

Closed
braddr wants to merge 1 commit intodlang:masterfrom
braddr:remove-old-druntime-interface
Closed

Remove old druntime interface#7
braddr wants to merge 1 commit intodlang:masterfrom
braddr:remove-old-druntime-interface

Conversation

@braddr
Copy link
Member

@braddr braddr commented Feb 14, 2011

The new non-vararg interfaces to druntime works for both 32 and 64, so let's drop the old version in favor of the new one. It's simpler, more portable, and having just one interface reduces maintenance costs.

@WalterBright
Copy link
Member

I want to wait on this a while longer before breaking old compiled code.

@yebblies
Copy link
Contributor

It's been over 6 months, is there a plan for when this will get merged in?

@braddr
Copy link
Member Author

braddr commented Aug 30, 2011

I'd be happy to update it to current, but it's also very low priority cleanup. I mostly did it because it was easy and it was a good way to play with the pull system back right after we'd moved to github.

@yebblies
Copy link
Contributor

I consider anything that removes redundant or dead code from the glue layer to be very useful. It's a very scary and confusing part of the compiler for me.

As it's also one of the oldest pull requests, and fairly straightforward, I was wondering how long Walter planned to wait.

@WalterBright
Copy link
Member

Brad, if you want to update the pull request, I'll fold it in. Also, a lot of the changes appear to be gratuitous whitespace changes - please run detab over files before checking them in.

@braddr
Copy link
Member Author

braddr commented Aug 30, 2011

On Monday, August 29, 2011 8:40:23 PM, WalterBright wrote:

Brad, if you want to update the pull request, I'll fold it in. Also, a lot of the changes appear to be gratuitous whitespace changes - please run detab over files before checking them in.

I'll update. They're not gratuitious whitespace changes though.. it's
removal of a layer of if()'s.

@braddr
Copy link
Member Author

braddr commented Aug 30, 2011

Hrm.. updating it to current code is trivial, but one of the interpret tests is failing and the stack trace looks very familiar.. something I hit when I played with this before. I don't recall what I did to fix it, or if I even did. Essentially everything passes except for the dmd test compilable/interpret3.d. The problem has to do with AA Literals:

#0 0x0818a637 in TemplateInstance::semantic (this=0x8468b08, sc=0x0, fargs=0x0) at template.c:3795
#1 0x0818a5f2 in TemplateInstance::semantic (this=0x8468b08, sc=0x0) at template.c:3765
#2 0x081405b3 in TypeAArray::getImpl (this=0x8276268) at mtype.c:3989
#3 0x08197825 in TypeInfoAssociativeArrayDeclaration::toDt (this=0x8468958, pdt=0x84679b8) at typinf.c:428
#4 0x0819898a in TypeInfoDeclaration::toObjFile (this=0x8468958, multiobj=0) at typinf.c:748
#5 0x081967e6 in Type::getTypeInfo (this=0x8276268, sc=0x0) at typinf.c:147
#6 0x08197776 in TypeInfoAssociativeArrayDeclaration::toDt (this=0x84687e8, pdt=0x84675f0) at typinf.c:421
#7 0x0819898a in TypeInfoDeclaration::toObjFile (this=0x84687e8, multiobj=0) at typinf.c:748
#8 0x081967e6 in Type::getTypeInfo (this=0x837af08, sc=0x0) at typinf.c:147
#9 0x080c8432 in AssocArrayLiteralExp::toElem (this=0x837ae78, irs=0xbfffedf0) at e2ir.c:4733
#10 0x080c15b5 in BinExp::toElemBin (this=0x837afb8, irs=0xbfffedf0, op=56) at e2ir.c:2066
#11 0x080c3c3d in AssignExp::toElem (this=0x837afb8, irs=0xbfffedf0) at e2ir.c:2930
#12 0x080bec3b in Dsymbol_toElem (s=0x8276de0, irs=0xbfffedf0) at e2ir.c:1166
#13 0x080bef3d in DeclarationExp::toElem (this=0x8276e90, irs=0xbfffedf0) at e2ir.c:1230
#14 0x080bdf70 in Expression::toElemDtor (this=0x8276e90, irs=0xbfffedf0) at e2ir.c:695
#15 0x0816c394 in ExpStatement::toIR (this=0x8276e78, irs=0xbfffedf0) at s2ir.c:1314
#16 0x0816c461 in CompoundStatement::toIR (this=0x8276fb8, irs=0xbfffedf0) at s2ir.c:1351
#17 0x0816c461 in CompoundStatement::toIR (this=0x837b0c8, irs=0xbfffedf0) at s2ir.c:1351
#18 0x08116158 in FuncDeclaration::toObjFile (this=0x8276c70, multiobj=0) at glue.c:928
#19 0x0804b727 in AttribDeclaration::toObjFile (this=0x8277508, multiobj=0) at attrib.c:242
#20 0x08114a5a in Module::genobjfile (this=0x8230270, multiobj=0) at glue.c:276
#21 0x0813465a in main (argc=13, argv=0x8226520) at mars.c:1319

frame 0 is:
3795 tinst = sc->tinst;

frame 9 is here:
4731 e = el_params(el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(svalues)),
4732 el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(skeys )),
4733 --> ta->getTypeInfo(NULL)->toElem(irs),
4734 NULL);

Given that this isn't urgent at all, I'm going to set it aside. If anyone else wants to dive into it, the changes shown in the diff are essentially search for aaGetSymbol in e2ir.c and make the I64 branch the only case. The variable in those cases isn't about 64 bitness but about druntime api versioning.

@yebblies
Copy link
Contributor

It's trying to run semantic on the AA template without a scope. I think using object.d's global scope is the correct solution.

yebblies@4b3b7d5#diff-2

@braddr
Copy link
Member Author

braddr commented Aug 30, 2011

Key question: Why is that new block of code required? It wasn't before and isn't required on 64 bits, just 32 bits. Secondary becomes, why doesn't the type instance have a scope already? Is it really ok to borrow the parent scope? My instincts tell me to figure out why it doesn't already have one, not figure out how to get one.

@yebblies
Copy link
Contributor

Fair enough, I'll find the answer tomorrow. My instinct tells me the explanation is that the semi-library aa implementation is borked, as usual.

@yebblies
Copy link
Contributor

By tomorrow I meant 2 weeks. The reason it doesn't fail on 64bit is this - you disabled it.

@yebblies
Copy link
Contributor

#381 should fix the segfault.
Would you like to update this patch now there's a solution?

@braddr
Copy link
Member Author

braddr commented Sep 14, 2011

Aren't you glad I pushed for a better root cause determination? :) I'd forgotten all about that other bug (filed quite a few 64 bit bugs that still aren't fixed while doing the d2 x86/64 work). After pull 381 is incorporated I'll update this one and re-test it. Assuming all goes well, then this can be pulled in.

Thanks for doing the research.

@yebblies
Copy link
Contributor

sigh, yes. Hopefully one day I'll be able to push myself to do it.

@braddr
Copy link
Member Author

braddr commented Sep 16, 2011

Re-creating as a new pull request.

@braddr braddr closed this Sep 16, 2011
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 13, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 13, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 13, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 13, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 31, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 31, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 1, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 1, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 4, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 4, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 19, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 19, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 25, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 25, 2016
skl131313 pushed a commit to skl131313/dmd that referenced this pull request Jan 28, 2017
@wilzbach wilzbach mentioned this pull request Jul 23, 2018
7 tasks
kinke pushed a commit that referenced this pull request Nov 14, 2024
Add hooks to take a release the slock in order to stop the world.
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 16, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 27, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request May 15, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
gorsing referenced this pull request in gorsing/dmd Jul 14, 2025
# This is the 1st commit message:

refactoring

# This is the commit message #2:

refactoring

# This is the commit message #3:

refactoring

# This is the commit message #4:

refactoring

# This is the commit message #5:

refactoring

# This is the commit message #6:

refactoring

# This is the commit message #7:

refactoring

# This is the commit message #8:

refactor/irstate-attrs

refactoring

add pragma(inline, true)

change pragma(inline, true) -> pragma(inline, false)

introduce root.Array.only and test it out in expressionsem (dlang#21520)

[attrib.d] remove unused semantic import

[dstruct.d] remove unused import

[aggregate.d] move `searchCtor` to `expressionsem.d`

remove some now unused semantic symbols from the import list.

[cond.d] remove unused `typesem` import (dlang#21538)

[expression.d] restrict `typesem` import

fix dlang#19587 No debug line info for simple code blocks (dlang#21544)

set location info on return statement, not only on return expression

[dsymbol.d] remove dependance on glue layer (dlang#21532)

move `loadModuleFromLibrary` to `dsymbolsem.d` (dlang#21535)

remove `dmodule.d` dependance of a few more `dsymbolsem.d` symbols.

[func.d] remove dependance on glue layer (dlang#21534)

[aggregate.d] move `checkOverlappedFields` to `dsymbolsem.d` (dlang#21542)

and make private

Templatize `_adEq2` (dlang#21513)

* Mark array literals as `on-stack` to bypass `@nogc` analysis

* Update `fail_compilation` test output

After updating the memcmp-ability criteria, now dynamic array can also
be compared using `memcmp` if their element type is comparable bit by
bit.

refactor: use new array constructor throughout expressionsem

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring
ntrel added a commit to ntrel/dmd that referenced this pull request Nov 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Dec 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants