aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LiveVar/LiveVarSet.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-05 02:51:01 +0000
committerChris Lattner <sabre@nondot.org>2002-02-05 02:51:01 +0000
commit5e5dfa307a6999cef7cba6d1a594f880ab72c043 (patch)
treef57e9d4dd8fb10d74fa747964759e48f86e7ac9d /lib/Analysis/LiveVar/LiveVarSet.cpp
parent0665a5f1f5716a69982f4bcd654e5ace975d0c0a (diff)
* Eliminate the LiveVarSet class, making applyTranferFuncForMInst a static
function in the one .cpp file that uses it. Use ValueSet's instead. * Prepare to delete LiveVarSet.h & LiveVarSet.cpp * Eliminate the ValueSet class, making all old member functions into global templates that will eventually be moved to Support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/LiveVarSet.cpp')
-rw-r--r--lib/Analysis/LiveVar/LiveVarSet.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/Analysis/LiveVar/LiveVarSet.cpp b/lib/Analysis/LiveVar/LiveVarSet.cpp
index 9243d05981..e69de29bb2 100644
--- a/lib/Analysis/LiveVar/LiveVarSet.cpp
+++ b/lib/Analysis/LiveVar/LiveVarSet.cpp
@@ -1,37 +0,0 @@
-#include "llvm/Analysis/LiveVar/LiveVarSet.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Type.h"
-
-// This function applies a machine instr to a live var set (accepts OutSet) and
-// makes necessary changes to it (produces InSet). Note that two for loops are
-// used to first kill all defs and then to add all uses. This is because there
-// can be instructions like Val = Val + 1 since we allow multipe defs to a
-// machine instruction operand.
-
-
-void LiveVarSet::applyTranferFuncForMInst(const MachineInstr *MInst) {
- for (MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done(); ++OpI) {
- if (OpI.isDef()) // kill only if this operand is a def
- insert(*OpI); // this definition kills any uses
- }
-
- // do for implicit operands as well
- for ( unsigned i=0; i < MInst->getNumImplicitRefs(); ++i) {
- if (MInst->implicitRefIsDefined(i))
- erase(MInst->getImplicitRef(i));
- }
-
-
- for (MachineInstr::val_const_op_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
- insert(*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))
- insert(MInst->getImplicitRef(i));
- }
-}