Reapply r110396, with fixes to appease the Linux buildbot gods.
[oota-llvm.git] / include / llvm / CodeGen / ProcessImplicitDefs.h
1 //===-------------- llvm/CodeGen/ProcessImplicitDefs.h ----------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10
11 #ifndef LLVM_CODEGEN_PROCESSIMPLICITDEFS_H
12 #define LLVM_CODEGEN_PROCESSIMPLICITDEFS_H
13
14 #include "llvm/CodeGen/MachineFunctionPass.h"
15 #include "llvm/ADT/SmallSet.h"
16
17 namespace llvm {
18
19   class MachineInstr;
20   class TargetInstrInfo;
21
22   /// Process IMPLICIT_DEF instructions and make sure there is one implicit_def
23   /// for each use. Add isUndef marker to implicit_def defs and their uses.
24   class ProcessImplicitDefs : public MachineFunctionPass {
25   private:
26
27     bool CanTurnIntoImplicitDef(MachineInstr *MI, unsigned Reg,
28                                 unsigned OpIdx, const TargetInstrInfo *tii_,
29                                 SmallSet<unsigned, 8> &ImpDefRegs);
30
31   public:
32     static char ID;
33
34     ProcessImplicitDefs() : MachineFunctionPass(ID) {}
35
36     virtual void getAnalysisUsage(AnalysisUsage &au) const;
37
38     virtual bool runOnMachineFunction(MachineFunction &fn);
39   };
40
41 }
42
43 #endif // LLVM_CODEGEN_PROCESSIMPLICITDEFS_H