How to determine all global variables of a LLVM module?
I want to modify them using a module pass.
llvm::Module
class has getGlobalList()
method:
/// Get the Module's list of global variables.
GlobalListType &getGlobalList() { return GlobalList; }
So you can do something like:
for (auto &Global : M->getModule()->getGlobalList()) ...