diff options
author | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-07-24 17:14:13 +0000 |
---|---|---|
committer | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-07-24 17:14:13 +0000 |
commit | 683847fb751890fb0ca16657be68f769bdff786c (patch) | |
tree | 7bdc59d4565c8d04335ddae7d2b5114292f51320 /lib/Analysis/LiveVar/LiveVarSet.cpp | |
parent | 2233a07b686ead865b0bfeed5a50d178d05f9549 (diff) |
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/LiveVarSet.cpp')
-rw-r--r-- | lib/Analysis/LiveVar/LiveVarSet.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Analysis/LiveVar/LiveVarSet.cpp b/lib/Analysis/LiveVar/LiveVarSet.cpp new file mode 100644 index 0000000000..c893817549 --- /dev/null +++ b/lib/Analysis/LiveVar/LiveVarSet.cpp @@ -0,0 +1,20 @@ +#include "llvm/Analysis/LiveVar/LiveVarSet.h" + + +// This function applies an instruction to a live var set (accepts OutSet) and +// makes necessary changes to it (produces InSet) + +void LiveVarSet::applyTranferFuncForInst(const Instruction *const Inst) +{ + + if( Inst->isDefinition() ) { // add to Defs iff this instr is a definition + remove(Inst); // this definition kills any uses + } + Instruction::op_const_iterator OpI = Inst->op_begin(); // get operand iterat + + for( ; OpI != Inst->op_end() ; OpI++) { // iterate over operands + if ( ((*OpI)->getType())->isLabelType()) continue; // don't process labels + add( *OpI ); // An operand is a use - so add to use set + } + +} |