In llvm::Module
there are 2 interesting fields:
typedef SymbolTableList FunctionListType;
typedef SymbolTableList
Local variables are allocated via alloca
at runtime.
To create AllocaInst you need to
llvm::BasicBlock::iterator I = ...
const llvm::Type *Ty =
auto AI = new AllocaInst(Ty, 0, Name, I);
To find allocas in a function you need to iterate over instructions:
for (auto I = F->begin(), E = F->end(); I != E; ++I) {
for (auto J = I->begin(), E = I->end(); J != E; ++J) {
if (auto AI = dyn_cast<AllocaInst>(*J)) {
..
}
}
}