Ruchira Sasanka | 683847f | 2001-07-24 17:14:13 +0000 | [diff] [blame^] | 1 | #include "llvm/Analysis/LiveVar/LiveVarSet.h" |
| 2 | |
| 3 | |
| 4 | // This function applies an instruction to a live var set (accepts OutSet) and |
| 5 | // makes necessary changes to it (produces InSet) |
| 6 | |
| 7 | void LiveVarSet::applyTranferFuncForInst(const Instruction *const Inst) |
| 8 | { |
| 9 | |
| 10 | if( Inst->isDefinition() ) { // add to Defs iff this instr is a definition |
| 11 | remove(Inst); // this definition kills any uses |
| 12 | } |
| 13 | Instruction::op_const_iterator OpI = Inst->op_begin(); // get operand iterat |
| 14 | |
| 15 | for( ; OpI != Inst->op_end() ; OpI++) { // iterate over operands |
| 16 | if ( ((*OpI)->getType())->isLabelType()) continue; // don't process labels |
| 17 | add( *OpI ); // An operand is a use - so add to use set |
| 18 | } |
| 19 | |
| 20 | } |