Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading