-
Notifications
You must be signed in to change notification settings - Fork 10
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
Handle the CXXDependentScopeMemberExpr here. #7
Conversation
From the look of Sema::ActOnMemberAccessExpr which calls Sema::ActOnDependentMemberExpr which in turn calls CXXDependentScopeMemberExpr::Create:
The real expression seems to be:
If the member has a NNS I think you can append it to the base expression with DotTypeExp (and you could add the member name to the NNS with TypeQualifed::addIdent) BTW I just figured this out while checking occurrences of CXXDependentScopeMemberExpr in Sema so there so there may be other similar Expr which are being mapped incorrectly. Could you fix it for CXXDependentScopeMemberExpr before the pull? |
Hello Elie, Yes, I’ll change things here and update the PR. Thanks, Kelly From: Elie Morisse [mailto:[email protected]] From the look of Sema::ActOnMemberAccessExpr which calls Sema::ActOnDependentMemberExpr which in turn calls CXXDependentScopeMemberExpr::Create: /// The main callback when the parser finds something like The real expression seems to be: CXXDependentScopeMemberExpr::getBase() | . or -> depending on isArrow() | getQualifier() (may be null) | getMember() | getExplicitTemplateArgs() If the member has a NNS I think you can append it to the base expression with DotTypeExp (and you could add the member name to the NNS with TypeQualifed::addIdent) BTW I just figured this out while checking occurrences of CXXDependentScopeMemberExpr in Sema so there so there may be other similar Expr which are being mapped incorrectly. Could you fix it for CXXDependentScopeMemberExpr before the pull? — |
Hello Elie, I forgot to send an email when I pushed a fix for this yesterday. Not sure if it is correct, though. I pushed another small PR for type mapping VectorType and it reminded of this. Thanks, Kelly From: Elie Morisse [mailto:[email protected]] From the look of Sema::ActOnMemberAccessExpr which calls Sema::ActOnDependentMemberExpr which in turn calls CXXDependentScopeMemberExpr::Create: /// The main callback when the parser finds something like The real expression seems to be: CXXDependentScopeMemberExpr::getBase() | . or -> depending on isArrow() | getQualifier() (may be null) | getMember() | getExplicitTemplateArgs() If the member has a NNS I think you can append it to the base expression with DotTypeExp (and you could add the member name to the NNS with TypeQualifed::addIdent) BTW I just figured this out while checking occurrences of CXXDependentScopeMemberExpr in Sema so there so there may be other similar Expr which are being mapped incorrectly. Could you fix it for CXXDependentScopeMemberExpr before the pull? — |
My mistake Kelly, I thought that DotTypeExp was similar to TypeExp and could be used to append a TypeQualified to an expression, whereas it's not the purpose of DotTypeExp at all. I can't think of a simple way to append TypeQualified's idents to the base expression. Seems like it's necessary to append them one by one with DotIdExp and DotTemplateInstanceExp. Would you prefer me to merge this after fixing it or do you prefer to fix it yourself? |
Hello Elie, You can go ahead and fix it up, if you like. The funny thing is that I was thinking that DotTypeExp wasn’t the correct approach as I was hammering it into place… :) One other expression that I keep running into, that isn’t implemented is the CXXPseudoDestructorExp. I just have it returning a new NullExpr for my tests here, as I don’t think there is a D equivalent. So if you wanted to add that also, then hopefully we have almost all of them covered. I will reiterate here (since I mentioned it with the VectorType PR and I have tried using three other C++ libs today) that the main problem I am running into now is as follows: `-CXXMethodDecl 0x75d12c8 <line:48:12, > col:12 implicit operator= 'struct zmq::i_pipe_events &(const struct zmq::i_pipe_events &)' inline noexcept-unevaluated 0x75d12c8 `-ParmVarDecl 0x75d1458 col:12 col:12 'const struct zmq::i_pipe_events &' ldc2: /usr/local/include/llvm/Support/Casting.h:95: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = clang::TranslationUnitDecl; From = clang::Decl]: Assertion `Val && "isa<> used on a null pointer"' failed. That is from a zeromq example. The last functions of the backtrace are ScopeChecker:: getScope and then the casting the ClassTemplateDecl is where the error occurs. The STL’s thread/random/etc. have the same type of error. Thanks, Kelly From: Elie Morisse [mailto:[email protected]] My mistake Kelly, I thought that DotTypeExp was similar to TypeExp and could be used to append a TypeQualified to an expression, whereas it's not the purpose of DotTypeExp at all. I can't think of a simple way to append TypeQualified's idents to the base expression. Seems like it's necessary to append them one by one with DotIdExp and DotTemplateInstanceExp. Would you prefer me to merge this after fixing it or do you prefer to do it yourself? — |
Could you give me an example I could debug? Or does just importing break? I'll have a look asap, but probably not tonight. |
Hello Elie, If you just run the ‘build.sh regex/’ example in the libstdc++ directory, it should give you the same error I am seeing elsewhere. Thanks, Kelly From: Elie Morisse [mailto:[email protected]] Could you give me an example I could debug? Or does just importing break? I'll have a look asap, but probably not tonight. — |
Hello Elie, I just noticed that the error that I mentioned in regards to regex.d is partly triggered by –std=c++11. Even bitset.d will show the same error with c++11 specified but will compile and run fine without. So I guess c++11 is just compiling in some feature that is triggering this error that shows up rarely in regular compilations? I tested zeromq without the c++11 flag and I still see the null pointer error starting at ScopeChecker, unfortunately. Just wanted to let you know. Thanks, Kelly From: Elie Morisse [mailto:[email protected]] Could you give me an example I could debug? Or does just importing break? I'll have a look asap, but probably not tonight. — |
Merged yesterday, and just before closing Kelly do you still see errors with ScopeChecker? |
Hello Elie, I don’t see any more errors with ScopeChecker, so it should be fine. Thanks, Kelly From: Elie Morisse [mailto:[email protected]] Merged yesterday, and just before closing Kelly do you still see errors with ScopeChecker? — |
This is quite similar to DependentDeclRefExpr. Compiles a couple of iterator uses for std::array now.