Skip to content

Conversation

teresajohnson
Copy link
Contributor

Explicit calls to ::operator new are marked nobuiltin and cannot be
elided or updated as they may call user defined versions. However,
existing calls to the hot/cold versions of new only need their hint
parameter value updated, which does not mutate the call.

Explicit calls to ::operator new are marked nobuiltin and cannot be
elided or updated as they may call user defined versions. However,
existing calls to the hot/cold versions of new only need their hint
parameter value updated, which does not mutate the call.
Copy link

@snehasish snehasish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines +1724 to +1725
// cases where the call is marked nobuiltin (because operator new called
// explicitly) and therefore cannot be replaced with a different callee.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why the distinction of being called explicitly matters for builtin vs no-builtin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ standard: There's a reference to that here: https://clang.llvm.org/docs/LanguageExtensions.html#builtin-operator-new-and-builtin-operator-delete. I see some older conversations about this from Richard Smith.

@teresajohnson teresajohnson merged commit ad4594e into llvm:main Sep 2, 2025
10 checks passed
Copy link
Contributor

@kazutakahirata kazutakahirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

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.

3 participants