blob: c89381754947caab65842db8a1c36e3ca30ece83 [file] [log] [blame]
Ruchira Sasanka683847f2001-07-24 17:14:13 +00001#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
7void 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}