aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorRuchira Sasanka <sasanka@students.uiuc.edu>2001-10-15 16:58:50 +0000
committerRuchira Sasanka <sasanka@students.uiuc.edu>2001-10-15 16:58:50 +0000
commitb8354a8e4f2cd93fa5f82a77b300f1d327354816 (patch)
treef737a0ecdf03e232dfd2cf2b48cd0deeed252fe9 /lib/Analysis
parenta90e77061d52076d9edf09b2f1ae42db04ff14d4 (diff)
downloadexternal_llvm-b8354a8e4f2cd93fa5f82a77b300f1d327354816.zip
external_llvm-b8354a8e4f2cd93fa5f82a77b300f1d327354816.tar.gz
external_llvm-b8354a8e4f2cd93fa5f82a77b300f1d327354816.tar.bz2
--added support for implicit operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/LiveVar/LiveVarSet.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/Analysis/LiveVar/LiveVarSet.cpp b/lib/Analysis/LiveVar/LiveVarSet.cpp
index 07dc128..1ca65f0 100644
--- a/lib/Analysis/LiveVar/LiveVarSet.cpp
+++ b/lib/Analysis/LiveVar/LiveVarSet.cpp
@@ -14,27 +14,34 @@ void LiveVarSet::applyTranferFuncForMInst(const MachineInstr *const MInst)
for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; OpI++) {
- if( OpI.isDef() ) { // kill only if this operand is a def
+ if( OpI.isDef() ) // kill only if this operand is a def
remove(*OpI); // this definition kills any uses
- }
+ }
+ // do for implicit operands as well
+ for( unsigned i=0; i < MInst->getNumImplicitRefs(); ++i) {
+ if( MInst->implicitRefIsDefined(i) )
+ remove( MInst->getImplicitRef(i) );
}
+
for( MachineInstr::val_op_const_iterator OpI(MInst); !OpI.done() ; OpI++) {
if ( ((*OpI)->getType())->isLabelType()) continue; // don't process labels
-
- if( ! OpI.isDef() ) { // add only if this operand is a use
+
+ if( ! OpI.isDef() ) // add only if this operand is a use
add( *OpI ); // An operand is a use - so add to use set
- }
}
-}
-
-
-
+ // do for implicit operands as well
+ for( unsigned i=0; i < MInst->getNumImplicitRefs(); ++i) {
+ if( ! MInst->implicitRefIsDefined(i) )
+ add( MInst->getImplicitRef(i) );
+ }
+}
+
#if 0
void LiveVarSet::applyTranferFuncForInst(const Instruction *const Inst)