mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 17:36:05 +00:00
[ByteCode] Avoid repeated hash lookups (NFC) (#132141)
This commit is contained in:
parent
71935281e0
commit
c38ef58557
@ -213,12 +213,12 @@ std::optional<unsigned> Program::createGlobal(const ValueDecl *VD,
|
||||
if (auto Idx =
|
||||
createGlobal(VD, VD->getType(), IsStatic, IsExtern, IsWeak, Init)) {
|
||||
for (const Decl *P = VD; P; P = P->getPreviousDecl()) {
|
||||
unsigned &PIdx = GlobalIndices[P];
|
||||
if (P != VD) {
|
||||
unsigned PIdx = GlobalIndices[P];
|
||||
if (Globals[PIdx]->block()->isExtern())
|
||||
Globals[PIdx] = Globals[*Idx];
|
||||
}
|
||||
GlobalIndices[P] = *Idx;
|
||||
PIdx = *Idx;
|
||||
}
|
||||
return *Idx;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user