2017-03-06 55 views

回答

4

llvm::Module類有getGlobalList()方法:

/// Get the Module's list of global variables. 
GlobalListType   &getGlobalList()    { return GlobalList; } 

所以,你可以這樣做:

for (auto &Global : M->getModule()->getGlobalList()) ...