-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Move newScope
out of AST nodes to dsymbolsem.d
#16880
Conversation
Thanks for your pull request and interest in making D better, @dchidindu5! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. 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. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#16880" |
Initially
|
Thanks @thewilsonator , the issues were solved but some thing happened along the line
After it was turned into a visitor
then this was done
an error occured
This is the only error for now I simply do not understand fully. |
whoops, |
newScope
for super
of type dmd.visitor.Visitor
newScope
out of AST nodes to dsymbolsem.d
the compiler has been built successfully but I need to run the test suite @thewilsonator |
OK, so push your changes that fix compilation, and the CI will run (I think I or someone else will need to approve it since you are still a first time committer here). |
@thewilsonator I ran the test suite for dmd and this occured
I noticed the posix.mak is deprecated. so I tried this
and this error occurred
Does that mean that the make file is missing in the current directory.? |
No idea, try |
okayy |
I've implemented the changes and I've closed up the indentations |
I actually implement Razvan's suggestion here #16880 (comment) |
make -f posix.mak |
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.
Looking good!
@@ -448,4 +448,5 @@ namespace dmd | |||
Dsymbol *search(Dsymbol *d, const Loc &loc, Identifier *ident, SearchOptFlags flags = (SearchOptFlags)SearchOpt::localsOnly); | |||
void setScope(Dsymbol *d, Scope *sc); | |||
void importAll(Dsymbol *d, Scope *sc); | |||
Scope* newScope(Dsymbol *d, Scope *sc); |
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.
...in which case remove this from this header
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.
if for some reason it needs to be, you will also need to update frontend.h
with the same changes (look for a failure on the CircleCI tester)
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.
Razvan said I only should remove newScope from attrib.h
@thewilsonator
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.
Yes, but that doesn't mean you need add it here. You must do one of two things:
-
leave
newScope
extern(C++), leave this
dsymbol.haddition here and add it to
frontend.h` (see the Circle CI failure) -
make
newScope
extern(D)
and remove this addition (and don't updatefrontend.h
, because there is nothing that needs updating).
newScope
is unused by LDC and from what I can tell is unused by GDC, so there is no need for it to be extern(C++)
.
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.
it says "newly generated header file (/home/circleci/dmd/generated/linux/release/64/frontend.h) doesn't match with the reference header file (/home/circleci/dmd/compiler/src/dmd/frontend.h) and The file src/dmd/frontend.h
seems to be out of sync. This is likely because changes were made which affect the C++ interface used by GDC and LDC.
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.
I think I got it now
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.
Yes, this is because newScope
is extern(C++)
. See also the diff that is says you should apply:
diff --git a/home/circleci/dmd/compiler/src/dmd/frontend.h b/home/circleci/dmd/generated/linux/release/64/frontend.h
index 23d404ba6b..9e08f3cd0b 100644
--- a/home/circleci/dmd/compiler/src/dmd/frontend.h
+++ b/home/circleci/dmd/generated/linux/release/64/frontend.h
@@ -6214,7 +6214,6 @@ class AttribDeclaration : public Dsymbol
public:
Array<Dsymbol* >* decl;
virtual Array<Dsymbol* >* include(Scope* sc);
- virtual Scope* newScope(Scope* sc);
void addComment(const char* comment) override;
const char* kind() const override;
bool oneMember(Dsymbol*& ps, Identifier* ident) override;
@@ -6231,7 +6230,6 @@ class StorageClassDeclaration : public AttribDeclaration
public:
StorageClass stc;
StorageClassDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
bool oneMember(Dsymbol*& ps, Identifier* ident) final override;
StorageClassDeclaration* isStorageClassDeclaration() override;
void accept(Visitor* v) override;
@@ -6243,7 +6241,6 @@ public:
Expression* msg;
const char* msgstr;
DeprecatedDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
void accept(Visitor* v) override;
};
@@ -6253,7 +6250,6 @@ public:
LINK linkage;
static LinkDeclaration* create(const Loc& loc, LINK p, Array<Dsymbol* >* decl);
LinkDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
const char* toChars() const override;
void accept(Visitor* v) override;
};
@@ -6263,7 +6259,6 @@ class CPPMangleDeclaration final : public AttribDeclaration
public:
CPPMANGLE cppmangle;
CPPMangleDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
const char* toChars() const override;
void accept(Visitor* v) override;
};
@@ -6273,7 +6268,6 @@ class CPPNamespaceDeclaration final : public AttribDeclaration
public:
Expression* exp;
CPPNamespaceDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
const char* toChars() const override;
void accept(Visitor* v) override;
CPPNamespaceDeclaration* isCPPNamespaceDeclaration() override;
@@ -6285,7 +6279,6 @@ public:
Visibility visibility;
_d_dynamicArray< Identifier* > pkg_identifiers;
VisibilityDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
const char* kind() const override;
const char* toPrettyChars(bool __param_0_) override;
VisibilityDeclaration* isVisibilityDeclaration() override;
@@ -6298,7 +6291,6 @@ public:
Array<Expression* >* exps;
structalign_t salign;
AlignDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
void accept(Visitor* v) override;
};
@@ -6321,7 +6313,6 @@ class PragmaDeclaration final : public AttribDeclaration
public:
Array<Expression* >* args;
PragmaDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
const char* kind() const override;
void accept(Visitor* v) override;
};
@@ -6374,7 +6365,6 @@ class ForwardingAttribDeclaration final : public AttribDeclaration
public:
ForwardingScopeDsymbol* sym;
ForwardingAttribDeclaration(Array<Dsymbol* >* decl);
- Scope* newScope(Scope* sc) override;
ForwardingAttribDeclaration* isForwardingAttribDeclaration() override;
void accept(Visitor* v) override;
};
@@ -6396,7 +6386,6 @@ class UserAttributeDeclaration final : public AttribDeclaration
public:
Array<Expression* >* atts;
UserAttributeDeclaration* syntaxCopy(Dsymbol* s) override;
- Scope* newScope(Scope* sc) override;
const char* kind() const override;
void accept(Visitor* v) override;
};
@@ -7407,6 +7396,8 @@ public:
void visit(StaticForeachDeclaration* _) override;
};
+extern Scope* newScope(Dsymbol* d, Scope* sc);
+
class NrvoWalker final : public StatementRewriteWalker
{
public:
Note that you should leave out that last addition if you make newScope
extern(D)
Note that you still need to remove the I think that is the last thing that you need to do for this. |
I deleted newScope from Right?? changes done locally only |
|
can I go on with the commit?? |
I'm not sure what you mean there, but this has to pass CI for me to merge it. And Circle tests that |
I mean I've done the changes and I want to update the commit |
You don't need to ask permission to do that. |
SAOC 24
I've got several errors but I'm interested in how to solve this one
Any suggestion as too how to fix them?
What am I doing wrong?