[for information only] LDC diff with DMD: 2.077.1#7506
[for information only] LDC diff with DMD: 2.077.1#7506JohanEngelen wants to merge 1 commit intodlang:masterfrom
Conversation
…3d3f) onto DMD 2.077.1
|
Thanks for your pull request, @JohanEngelen! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
ibuclaw
left a comment
There was a problem hiding this comment.
There's an awful lot here, and I gave up looking at it. :-)
| void semanticTypeInfoMembers(); | ||
| Dsymbol *search(Loc, Identifier *ident, int flags = SearchLocalsOnly); | ||
| const char *kind(); | ||
| const char *kind() const; |
| } | ||
| return createNewScope(sc, sc.stc, sc.linkage, sc.cppmangle, sc.protection, sc.explicitProtection, sc.aligndecl, inlining); | ||
| } | ||
| else if (IN_LLVM && ident == Id.LDC_profile_instr) { |
There was a problem hiding this comment.
Propose a way to add pragmas to the frontend via a hook. (Maybe #7457 might be the place to put it).
| void addMember(Scope *sc, ScopeDsymbol *sds); | ||
| void setScope(Scope *sc); | ||
| void importAll(Scope *sc); | ||
| void semantic(Scope *sc); |
There was a problem hiding this comment.
Why? Semantic passes should have been removed and visitor()-ized.
There was a problem hiding this comment.
It's just a merge artefact – benign, as the function is not virtual, but fixed in master nevertheless.
| Dsymbols *include(Scope *sc, ScopeDsymbol *sds); | ||
| void addMember(Scope *sc, ScopeDsymbol *sds); | ||
| void addComment(const char *comment); | ||
| void addComment(const utf8_t *comment); |
There was a problem hiding this comment.
Wasn't this committed recently?
| version(IN_LLVM) | ||
| { | ||
|
|
||
| private Type getTypeOfOverloadedIntrinsic(FuncDeclaration fd) |
There was a problem hiding this comment.
Maybe same as per comment on pragmas. Need a way to extend front-end built-ins for each compiler (although gdc just ignores this module).
| // if there is no offset. With an offset, we can at least say that it is | ||
| // non-zero. | ||
| SymOffExp soe = cast(SymOffExp) e; | ||
| if (soe.var.llvmInternal == LDCPragma.LLVMextern_weak && !soe.offset) |
There was a problem hiding this comment.
Bug / test for this? Seems innocuous.
There was a problem hiding this comment.
This is related to an LDC-only pragma, LDC_extern_weak, which can be used to implement ELF-style weak symbols (on targets that support them). The frontend would constant-fold away the null checks to see whether they are present, since it assumed that symbol addresses are always non-zero (the 2 below). There is a regression test for it in our lit test suite.
(In fact, the pragma was never publicly documented, as I wanted to have something portable across the compilers instead, but I needed it to implement shared libraries in a way that is compatible with --gc-sections due to a certain ld.bfd bug. If the pragma was added upstream, this hunk would also apply.)
| { | ||
| // Cast the CommaExp instead of the inner rhs; this fixes | ||
| // https://github.com/ldc-developers/ldc/issues/2415. | ||
| result = new CastExp(e.loc, e, e2c.type); |
There was a problem hiding this comment.
Can't you handle this properly in code-gen?
|
|
||
| // Whether to emit instrumentation code if -fprofile-instr-generate is specified, | ||
| // the value is set with pragma(LDC_profile_instr, true|false) | ||
| bool emitInstrumentation; |
There was a problem hiding this comment.
Can't you do heuristics at code-gen level?
| errorSupplemental(loc, "ldc2 might not be correctly installed."); | ||
| errorSupplemental(loc, "Please check your ldc2.conf configuration file."); | ||
| errorSupplemental(loc, "Installation instructions can be found at http://wiki.dlang.org/LDC."); | ||
| } |
There was a problem hiding this comment.
We need a way to have a per-compiler message here, again with Compiler hook.
| // Coverage analysis | ||
| void* d_cover_valid; // llvm::GlobalVariable* --> private immutable size_t[] _d_cover_valid; | ||
| void* d_cover_data; // llvm::GlobalVariable* --> private uint[] _d_cover_data; | ||
| Array!size_t d_cover_valid_init; // initializer for _d_cover_valid |
There was a problem hiding this comment.
Can't you attach this data to LLVM AST?
|
Why is this being merged into dmd? Unless tests get added for it, it'll constantly be broken and just adds bloat otherwise. |
|
@skl131313 It's just informational. It is not intended to be merged. |
|
@ibuclaw @JohanEngelen Since dmd doesn't use the C++ .h files anymore, I'll defer the merging of them to you guys. |
Well, any changes to struct/class layout must also be reflected on the D side too. Otherwise there'd be linker problems, or worse, runtime corruption. |
|
So what's the story here? There seems to be a lot of good stuff here but it's in a form that's difficult to review. |
|
@JohanEngelen Has this PR served its purpose? Can you update it, or can we close it? |
Copy-paste of LDC master 24 Dec (8c0abd5220e4993d66336b57742c1988dfd73d3f) onto DMD 2.077.1
Continuation of #4688
Note: parts of the diff have already been applied to DMD master.