1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02: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.

llvm-svn: 288652
This commit is contained in:
Matthias Braun 2016-12-05 07:35:09 +00:00
parent 2fed8dafce
commit 38cd0376b5

View File

@ -1221,6 +1221,7 @@ public:
//===----------------------------------------------------------------------===//
class RecordVal {
friend class Record;
Init *Name;
PointerIntPair<RecTy *, 1, bool> TyAndPrefix;
Init *Value;
@ -1359,7 +1360,7 @@ public:
const RecordVal *getValue(const Init *Name) const {
for (const RecordVal &Val : Values)
if (Val.getNameInit() == Name) return &Val;
if (Val.Name == Name) return &Val;
return nullptr;
}
@ -1369,7 +1370,7 @@ public:
RecordVal *getValue(const Init *Name) {
for (RecordVal &Val : Values)
if (Val.getNameInit() == Name) return &Val;
if (Val.Name == Name) return &Val;
return nullptr;
}