mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add well-known identifier caching (#6486)
I'm doing this because I figured it'd be an incremental improvement for all the operator lookups that we do. Even to the extent that we've discussed witness caching, I think it'll still apply. It does add one more step to adding new interfaces (before, you'd just write the string, now you add it to the def file and reference it). I'll claim it makes GetClangOperatorKind a lot friendlier to read/edit, nevermind removing the string comparisons. :)
This commit is contained in:
@@ -38,7 +38,8 @@ Context::Context(DiagnosticEmitterBase* emitter,
|
||||
global_init_(this),
|
||||
region_stack_([this](SemIR::LocId loc_id, std::string label) {
|
||||
TODO(loc_id, label);
|
||||
}) {
|
||||
}),
|
||||
core_identifiers_(&identifiers()) {
|
||||
// Prepare fields which relate to the number of IRs available for import.
|
||||
import_irs().Reserve(imported_ir_count);
|
||||
import_ir_constant_values_.reserve(imported_ir_count);
|
||||
|
||||
Reference in New Issue
Block a user