@@ -30,7 +30,10 @@ using namespace swift;
30
30
namespace {
31
31
32
32
struct 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;
34
37
35
38
AccessibleFunctionsSection (const AccessibleFunctionRecord *begin,
36
39
const AccessibleFunctionRecord *end)
@@ -51,20 +54,20 @@ struct AccessibleFunctionCacheEntry {
51
54
const char *Name;
52
55
size_t NameLength;
53
56
54
- const AccessibleFunctionRecord *Func ;
57
+ const AccessibleFunctionRecord *__ptrauth_swift_accessible_function_record R ;
55
58
56
59
public:
57
60
AccessibleFunctionCacheEntry (llvm::StringRef name,
58
- const AccessibleFunctionRecord *func )
59
- : Func(func ) {
61
+ const AccessibleFunctionRecord *record )
62
+ : R(record ) {
60
63
char *Name = reinterpret_cast <char *>(malloc (name.size ()));
61
64
memcpy (Name, name.data (), name.size ());
62
65
63
66
this ->Name = Name;
64
67
this ->NameLength = name.size ();
65
68
}
66
69
67
- const AccessibleFunctionRecord *getFunction () const { return Func ; }
70
+ const AccessibleFunctionRecord *getRecord () const { return R ; }
68
71
69
72
bool matchesKey (llvm::StringRef name) {
70
73
return name == llvm::StringRef{Name, NameLength};
@@ -139,21 +142,21 @@ swift::runtime::swift_findAccessibleFunction(const char *targetNameStart,
139
142
{
140
143
auto snapshot = S.Cache .snapshot ();
141
144
if (auto E = snapshot.find (name))
142
- return E->getFunction ();
145
+ return E->getRecord ();
143
146
}
144
147
145
148
// If entry doesn't exist (either record doesn't exist, hasn't been loaded, or
146
149
// requested yet), let's try to find it and add to the cache.
147
150
148
- auto *function = _searchForFunctionRecord (S, name);
149
- if (function ) {
151
+ auto *record = _searchForFunctionRecord (S, name);
152
+ if (record ) {
150
153
S.Cache .getOrInsert (
151
154
name, [&](AccessibleFunctionCacheEntry *entry, bool created) {
152
155
if (created)
153
- new (entry) AccessibleFunctionCacheEntry{name, function };
156
+ new (entry) AccessibleFunctionCacheEntry{name, record };
154
157
return true ;
155
158
});
156
159
}
157
160
158
- return function ;
161
+ return record ;
159
162
}
0 commit comments