[all-commits] [llvm/llvm-project] 7337fe: [clang] Avoid per-builtin std::string allocation i...
Cyndy Ishida via All-commits
all-commits at lists.llvm.org
Tue Jun 23 07:14:10 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7337fe1b09309fedbbdff2eb34043a0821523109
https://github.com/llvm/llvm-project/commit/7337fe1b09309fedbbdff2eb34043a0821523109
Author: Cyndy Ishida <cyndy_ishida at apple.com>
Date: 2026-06-23 (Tue, 23 Jun 2026)
Changed paths:
M clang/lib/Basic/Builtins.cpp
A clang/test/AST/builtin-name-registration.c
Log Message:
-----------
[clang] Avoid per-builtin std::string allocation in initializeBuiltins (#205162)
`initializeBuiltins()` previously registered every builtin through an
allocated std::string every time a `CompilerInstance` initialized. This
was hot for module-heavy builds, where each built module re-registered
the full set.
Add `getBuiltinNameInto()`, which writes the name into a caller-provided
buffer and returns a `StringRef`, with no allocation when the shard has
no prefix (the common case). `Info::getName` now delegates to it so the
two cannot diverge. This change is output behavior-preserving.
Resolves: rdar://178672190
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list