-
Notifications
You must be signed in to change notification settings - Fork 7
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
Improve operator resolution #129
Improve operator resolution #129
Conversation
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.
LGTM!
@vgvassilev, something is failing with cling. Call to |
Maybe |
void Cppyy::GetClassOperators(Cppyy::TCppScope_t klass, | ||
const std::string& opname, | ||
std::vector<TCppScope_t>& operators) { | ||
if (opname == "operator+") |
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.
This is something we can fold into an API: const char * GetOperatorKindAsString(Cpp::OperatorKind K);
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.
For this use case, shouldn't it be Cpp::OperatorKind Cpp::GetOperatorKindFromString(std::string op)
?
Also, I believe this should be part of InterOp.
Should I add both? Any thoughts?
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.
You are right. Let's keep it as is.
`GetMethodTemplate` now also checks for operators methods using `GetClassOperators` `GetGlobalOperator` can now handle templated types
Co-authored-by: Vassil Vassilev <v.g.vassilev@gmail.com>
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.
LGTM!
void Cppyy::GetClassOperators(Cppyy::TCppScope_t klass, | ||
const std::string& opname, | ||
std::vector<TCppScope_t>& operators) { | ||
if (opname == "operator+") |
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.
You are right. Let's keep it as is.
005777f
to
14b05fa
Compare
GetMethodTemplate
now also checks for operators methods usingGetClassOperators
GetGlobalOperator
can now handle templated typesFixes 2 tests. Along with compiler-research/CppInterOp#509, fixes 3 tests.