Skip to content

[WIP] New Overload Resolution - #150

Draft
Vipul-Cariappa wants to merge 10 commits into
compiler-research:mainfrom
Vipul-Cariappa:dev/overload-resolution
Draft

Vipul-Cariappa wants to merge 10 commits into
compiler-research:mainfrom
Vipul-Cariappa:dev/overload-resolution

Conversation

@Vipul-Cariappa

Copy link
Copy Markdown
Collaborator

No description provided.

@Vipul-Cariappa
Vipul-Cariappa force-pushed the dev/overload-resolution branch from 51d0efa to 2ba1f3e Compare October 13, 2026 06:15
@Vipul-Cariappa
Vipul-Cariappa marked this pull request as draft October 13, 2026 07:18
@Vipul-Cariappa
Vipul-Cariappa force-pushed the dev/overload-resolution branch 3 times, most recently from 6da5d69 to f0aab5a Compare October 13, 2026 11:28
`IsEquivalentTypes` checks whether two types are equivalent up to CVR
qualifiers, references and pointers, or whether one type derives from the
other. Through its out-parameters it reports how the types differ:
- `qual`: the CVR qualifiers that differ,
- `ref`: the kind of reference (lvalue/rvalue) that was stripped,
- `pointer`: whether a pointer was stripped.
@Vipul-Cariappa
Vipul-Cariappa force-pushed the dev/overload-resolution branch from f0aab5a to f48cc29 Compare October 13, 2026 11:29
* Remove SelectAndForward from TemplateProxy

SelectAndForward forwarded a template proxy call to one of its overload
sets: tpp_vectorcall tried the non-templated overloads (implicit
conversions allowed), then the known templated ones and finally the
low-priority ones (both without implicit conversions). "Adopt
Clang-driven overload resolution from CppInterOp" replaced that cascade
with a single Clang-driven selection and its three callers went away
with it; the static function has had no caller since (clang reports it
with -Wunused-function).

* Remove CPPDataMember_NewConstant

CPPDataMember_NewConstant built a static, constant data member
descriptor from a raw name and address, via the matching
CPPDataMember::Set(scope, name, address) overload. Nothing calls it
(it was already unused at 3df629f): every data member descriptor is
created by CPPDataMember_New from a reflected variable, including enum
constants. Remove the factory and the Set overload only it used.

* Remove Utility::PyErr_Occurred_WithGIL

It re-acquired the GIL around PyErr_Occurred() for callers that might
have released it. Nothing calls it (it was already unused at 3df629f);
the executors that release the GIL (GILControl in Executors.cxx) restore
it before checking for errors.

* remove unused call context enums based on new overload resolution

* Remove the write-only kHaveImplicit call flag

Converters set CallContext::kHaveImplicit when they rejected an argument
that an implicit conversion could have accepted. The old overload
resolution in mp_vectorcall read it through HaveImplicit() to decide
whether to retry all overloads in a second round with kAllowImplicit
(CPPOverload.cxx at 3df629f). "Adopt Clang-driven overload resolution
from CppInterOp" removed that second round, so HaveImplicit() lost its
only caller and the flag has been written but never read since.

Remove the four writes in Converters.cxx, HaveImplicit() and the
enumerator.

* Remove the unused is_conversion_operator computation

"Adopt Clang-driven overload resolution from CppInterOp" made
mp_vectorcall compute whether any overload in the set is a conversion
operator, but the result is never read (unlike is_operator, which is
passed on to BestOverloadFunctionMatch). Remove it together with
CPPMethod::IsConversionOperator, which it was the only caller of.

* Drop the unused <regex> include from Converters.cxx

Converters.cxx used std::regex only for s_fnptr, which recognized
function-pointer spellings in CreateConverter. "Adopt Clang-driven
overload resolution from CppInterOp" replaced that string matching with
type queries and removed s_fnptr; nothing in the file uses <regex> any
more.

* Remove unreachable statements after return/throw

* Remove SmartPtrConverter's never-overridden GetAddressSpecialCase

SmartPtrConverter declares its own virtual GetAddressSpecialCase that
always returns false, and no class derives from SmartPtrConverter, so
the special-case branch in SmartPtrConverter::SetArg (meant for e.g.
passing nullptr to a smart pointer reference) can never be taken. It
was already dead at 3df629f. Remove the hook, the branch and the TODO
that discussed it; non-instances are rejected as before.

* Drop the redundant unicodeobject.h include from TemplateProxy.cxx

"Adopt Clang-driven overload resolution from CppInterOp" added a direct
line above) already includes; nothing else in the file needed it.

* removed commented code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants