-
-
Notifications
You must be signed in to change notification settings - Fork 698
[for information only] LDC diff with DMD: 2.077.1 #7506
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,12 @@ import ddmd.tokens; | |
| import ddmd.semantic; | ||
| import ddmd.visitor; | ||
|
|
||
| version(IN_LLVM) | ||
| { | ||
| import gen.dpragma; | ||
| } | ||
|
|
||
|
|
||
| /*********************************************************** | ||
| */ | ||
| extern (C++) abstract class AttribDeclaration : Dsymbol | ||
|
|
@@ -806,6 +812,21 @@ extern (C++) final class PragmaDeclaration : AttribDeclaration | |
| } | ||
| 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) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Propose a way to add pragmas to the frontend via a hook. (Maybe #7457 might be the place to put it). |
||
| bool emitInstr = true; | ||
| if (!args || args.dim != 1 || !DtoCheckProfileInstrPragma((*args)[0], emitInstr)) { | ||
| error("pragma(LDC_profile_instr, true or false) expected"); | ||
| (*args)[0] = new ErrorExp(); | ||
| } else { | ||
| // Only create a new scope if the emitInstrumentation flag is changed | ||
| if (sc.emitInstrumentation != emitInstr) { | ||
| auto newscope = sc.copy(); | ||
| newscope.emitInstrumentation = emitInstr; | ||
| return newscope; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return sc; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,6 +186,7 @@ class StaticIfDeclaration : public ConditionalDeclaration | |
| void addMember(Scope *sc, ScopeDsymbol *sds); | ||
| void setScope(Scope *sc); | ||
| void importAll(Scope *sc); | ||
| void semantic(Scope *sc); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? Semantic passes should have been removed and visitor()-ized.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just a merge artefact – benign, as the function is not virtual, but fixed in master nevertheless. |
||
| const char *kind() const; | ||
| void accept(Visitor *v) { v->visit(this); } | ||
| }; | ||
|
|
@@ -199,10 +200,10 @@ class StaticForeachDeclaration : public ConditionalDeclaration | |
| Dsymbols *cache; | ||
|
|
||
| Dsymbol *syntaxCopy(Dsymbol *s); | ||
| bool oneMember(Dsymbol *ps, Identifier *ident); | ||
| bool oneMember(Dsymbol **ps, Identifier *ident); | ||
| Dsymbols *include(Scope *sc, ScopeDsymbol *sds); | ||
| void addMember(Scope *sc, ScopeDsymbol *sds); | ||
| void addComment(const char *comment); | ||
| void addComment(const utf8_t *comment); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wasn't this committed recently? |
||
| void setScope(Scope *sc); | ||
| void importAll(Scope *sc); | ||
| const char *kind() const; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?