[NFC][IR] Make Module::getGlobalList() private

This patch adds several missing GlobalList modifier functions, like
removeGlobalVariable(), eraseGlobalVariable() and insertGlobalVariable().
There is no longer need to access the list directly so it also makes
getGlobalList() private.

Differential Revision: https://reviews.llvm.org/D144027
This commit is contained in:
Vasileios Porpodas
2023-02-08 10:13:01 -08:00
parent 33d0d1e36f
commit ed3e3ee9e3
15 changed files with 151 additions and 28 deletions

View File

@@ -3693,7 +3693,7 @@ Error BitcodeReader::globalCleanup() {
UpgradedVariables.emplace_back(&GV, Upgraded);
for (auto &Pair : UpgradedVariables) {
Pair.first->eraseFromParent();
TheModule->getGlobalList().push_back(Pair.second);
TheModule->insertGlobalVariable(Pair.second);
}
// Force deallocation of memory for these vectors to favor the client that