Skip to content

Commit 9157cb0

Browse files
committed
[Runtime] NFC: Rename Function -> Record in AccessibleFunctionEntry and related variables
1 parent c70514a commit 9157cb0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

stdlib/public/runtime/AccessibleFunction.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ struct AccessibleFunctionCacheEntry {
5151
const char *Name;
5252
size_t NameLength;
5353

54-
const AccessibleFunctionRecord *Func;
54+
const AccessibleFunctionRecord *R;
5555

5656
public:
5757
AccessibleFunctionCacheEntry(llvm::StringRef name,
58-
const AccessibleFunctionRecord *func)
59-
: Func(func) {
58+
const AccessibleFunctionRecord *record)
59+
: R(record) {
6060
char *Name = reinterpret_cast<char *>(malloc(name.size()));
6161
memcpy(Name, name.data(), name.size());
6262

6363
this->Name = Name;
6464
this->NameLength = name.size();
6565
}
6666

67-
const AccessibleFunctionRecord *getFunction() const { return Func; }
67+
const AccessibleFunctionRecord *getRecord() const { return R; }
6868

6969
bool matchesKey(llvm::StringRef name) {
7070
return name == llvm::StringRef{Name, NameLength};
@@ -139,21 +139,21 @@ swift::runtime::swift_findAccessibleFunction(const char *targetNameStart,
139139
{
140140
auto snapshot = S.Cache.snapshot();
141141
if (auto E = snapshot.find(name))
142-
return E->getFunction();
142+
return E->getRecord();
143143
}
144144

145145
// If entry doesn't exist (either record doesn't exist, hasn't been loaded, or
146146
// requested yet), let's try to find it and add to the cache.
147147

148-
auto *function = _searchForFunctionRecord(S, name);
149-
if (function) {
148+
auto *record = _searchForFunctionRecord(S, name);
149+
if (record) {
150150
S.Cache.getOrInsert(
151151
name, [&](AccessibleFunctionCacheEntry *entry, bool created) {
152152
if (created)
153-
new (entry) AccessibleFunctionCacheEntry{name, function};
153+
new (entry) AccessibleFunctionCacheEntry{name, record};
154154
return true;
155155
});
156156
}
157157

158-
return function;
158+
return record;
159159
}

0 commit comments

Comments
 (0)