[MTE] [NFC] use vector to collect globals to tag (#120283)

The same pattern caused test failures in the HWASan pass, so is brittle.
Let's go for the easier approach.
This commit is contained in:
Florian Mayer 2024-12-18 00:38:19 -08:00 committed by GitHub
parent e532241b02
commit d9703501b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2444,11 +2444,14 @@ bool AsmPrinter::doFinalization(Module &M) {
// we can conditionalize accesses based on whether or not it is nullptr.
MF = nullptr;
for (GlobalVariable &G : make_early_inc_range(M.globals())) {
std::vector<GlobalVariable *> GlobalsToTag;
for (GlobalVariable &G : M.globals()) {
if (G.isDeclaration() || !G.isTagged())
continue;
tagGlobalDefinition(M, &G);
GlobalsToTag.push_back(&G);
}
for (GlobalVariable *G : GlobalsToTag)
tagGlobalDefinition(M, G);
// Gather all GOT equivalent globals in the module. We really need two
// passes over the globals: one to compute and another to avoid its emission