@@ -30,7 +30,10 @@ using namespace swift;
3030namespace {
3131
3232struct AccessibleFunctionsSection {
33- const AccessibleFunctionRecord *Begin, *End;
33+ const AccessibleFunctionRecord *__ptrauth_swift_accessible_function_record
34+ Begin;
35+ const AccessibleFunctionRecord *__ptrauth_swift_accessible_function_record
36+ End;
3437
3538 AccessibleFunctionsSection (const AccessibleFunctionRecord *begin,
3639 const AccessibleFunctionRecord *end)
@@ -51,20 +54,20 @@ struct AccessibleFunctionCacheEntry {
5154 const char *Name;
5255 size_t NameLength;
5356
54- const AccessibleFunctionRecord *Func ;
57+ const AccessibleFunctionRecord *__ptrauth_swift_accessible_function_record R ;
5558
5659public:
5760 AccessibleFunctionCacheEntry (llvm::StringRef name,
58- const AccessibleFunctionRecord *func )
59- : Func(func ) {
61+ const AccessibleFunctionRecord *record )
62+ : R(record ) {
6063 char *Name = reinterpret_cast <char *>(malloc (name.size ()));
6164 memcpy (Name, name.data (), name.size ());
6265
6366 this ->Name = Name;
6467 this ->NameLength = name.size ();
6568 }
6669
67- const AccessibleFunctionRecord *getFunction () const { return Func ; }
70+ const AccessibleFunctionRecord *getRecord () const { return R ; }
6871
6972 bool matchesKey (llvm::StringRef name) {
7073 return name == llvm::StringRef{Name, NameLength};
@@ -139,21 +142,21 @@ swift::runtime::swift_findAccessibleFunction(const char *targetNameStart,
139142 {
140143 auto snapshot = S.Cache .snapshot ();
141144 if (auto E = snapshot.find (name))
142- return E->getFunction ();
145+ return E->getRecord ();
143146 }
144147
145148 // If entry doesn't exist (either record doesn't exist, hasn't been loaded, or
146149 // requested yet), let's try to find it and add to the cache.
147150
148- auto *function = _searchForFunctionRecord (S, name);
149- if (function ) {
151+ auto *record = _searchForFunctionRecord (S, name);
152+ if (record ) {
150153 S.Cache .getOrInsert (
151154 name, [&](AccessibleFunctionCacheEntry *entry, bool created) {
152155 if (created)
153- new (entry) AccessibleFunctionCacheEntry{name, function };
156+ new (entry) AccessibleFunctionCacheEntry{name, record };
154157 return true ;
155158 });
156159 }
157160
158- return function ;
161+ return record ;
159162}
0 commit comments