Skip to content

annotate overloaded private class members where needed #51

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

Conversation

andrurogerz
Copy link
Collaborator

@andrurogerz andrurogerz commented May 5, 2025

Purpose

Running IDs across the LLVM source, I observed a few cases where private methods that should have been annotated due to being referenced in the same translation unit. In these instances, the missed private methods had overloads and their references were ambiguous. This PR addresses the issue and makes IDS properly flag these methods for export.

Overview

  1. Override VisitUnresolvedMemberExpr which gets called in this scenario. Invoke the existing export_function_if_needed for each method declaration the expression may reference. This is only done for private methods because public methods will always be annotated.
  2. Add a new test case. For this test force Clang language options to -fno-delayed-template-parsing, which is already the default on Linux and Darwin. This is required on Windows, where the default behavior is -fdelayed-template-parsing to better match MSVC behavior. More details here. Without this argument, the new test case does not pass when run on Windows.

Validation

  1. New tests case.
  2. Ran tests on Windows and Linux.
  3. Manually ran on a subset of the llvm headers and inspected results.

@andrurogerz andrurogerz marked this pull request as ready for review May 5, 2025 21:14
@andrurogerz andrurogerz requested a review from compnerd May 5, 2025 21:14
@andrurogerz andrurogerz force-pushed the template-calls-overloaded-private-method branch from 6b02a42 to 4521713 Compare May 5, 2025 22:28
@andrurogerz andrurogerz requested a review from compnerd May 5, 2025 22:30
@andrurogerz andrurogerz merged commit b14bf55 into compnerd:main May 5, 2025
2 checks passed
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