mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-21 13:33:26 +00:00
TableGen/Record: Shortcut member access in hottest function
This may seem unusual, but makes most debug tblgen builds ~10% faster. Usually we wouldn't care about speed that much in debug builds, but for tblgen that also translates into build time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288652 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f3a991b8e3
commit
53cf984ca8
@ -1221,6 +1221,7 @@ public:
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
class RecordVal {
|
class RecordVal {
|
||||||
|
friend class Record;
|
||||||
Init *Name;
|
Init *Name;
|
||||||
PointerIntPair<RecTy *, 1, bool> TyAndPrefix;
|
PointerIntPair<RecTy *, 1, bool> TyAndPrefix;
|
||||||
Init *Value;
|
Init *Value;
|
||||||
@ -1359,7 +1360,7 @@ public:
|
|||||||
|
|
||||||
const RecordVal *getValue(const Init *Name) const {
|
const RecordVal *getValue(const Init *Name) const {
|
||||||
for (const RecordVal &Val : Values)
|
for (const RecordVal &Val : Values)
|
||||||
if (Val.getNameInit() == Name) return &Val;
|
if (Val.Name == Name) return &Val;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1369,7 +1370,7 @@ public:
|
|||||||
|
|
||||||
RecordVal *getValue(const Init *Name) {
|
RecordVal *getValue(const Init *Name) {
|
||||||
for (RecordVal &Val : Values)
|
for (RecordVal &Val : Values)
|
||||||
if (Val.getNameInit() == Name) return &Val;
|
if (Val.Name == Name) return &Val;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user