MachineFunction *MF = ...; // get a machine function MachineBasicBlock *MBB = ...; // get a machine basic block const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo(); MachineBasicBlock::iterator it = MBB->begin(); while (it != MBB->end()) { const MCInstrDesc &MCID = it->getDesc(); if (TII->isStackSlot(MCID.OpInfo[0])) // do something if the instruction uses a stack slot ++it; }In this example, we use the getDesc function to get the instruction descriptor for each instruction in a machine basic block. We then check whether the instruction uses a stack slot, and if so, we perform some action. The package library that contains the machinebasicblock iterator getDesc is the LLVM library.