Avoid DIDescriptor::getNode(). Use overloaded operators instead.
[oota-llvm.git] / include / llvm / CodeGen / RegisterCoalescer.h
index e7727d54347a07d787a0789b56a64fe797798ec8..1490aa0172fb04d5b16459deda1379fe3afbee7d 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
 //===----------------------------------------------------------------------===//
 
 #include "llvm/System/IncludeFile.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "llvm/CodeGen/LiveVariables.h"
-#include "llvm/Target/MRegisterInfo.h"
-#include "llvm/Support/Debug.h"
+#include "llvm/CodeGen/LiveInterval.h"
+#include "llvm/ADT/SmallPtrSet.h"
 
 #ifndef LLVM_CODEGEN_REGISTER_COALESCER_H
 #define LLVM_CODEGEN_REGISTER_COALESCER_H
 
-namespace llvm 
-{
+namespace llvm {
+
   class MachineFunction;
   class RegallocQuery;
   class AnalysisUsage;
-  class LiveIntervals;
   class MachineInstr;
-  class MRegisterInfo;
 
   /// An abstract interface for register coalescers.  Coalescers must
   /// implement this interface to be part of the coalescer analysis
@@ -47,7 +42,7 @@ namespace llvm
 
     /// Reset state.  Can be used to allow a coalescer run by
     /// PassManager to be run again by the register allocator.
-    virtual void reset(MachineFunction &mf) {};
+    virtual void reset(MachineFunction &mf) {}
 
     /// Register allocators must call this from their own
     /// getAnalysisUsage to cover the case where the coalescer is not
@@ -56,7 +51,7 @@ namespace llvm
     /// which to invalidate when running the register allocator or any
     /// pass that might call coalescing.  The long-term solution is to
     /// allow hierarchies of PassManagers.
-    virtual void getAnalysisUsage(AnalysisUsage &AU) const {};
+    virtual void getAnalysisUsage(AnalysisUsage &AU) const {}
   }; 
 
   /// An abstract interface for register allocators to interact with
@@ -69,11 +64,11 @@ namespace llvm
   ///
   ///   class LinearScanRegallocQuery : public RegallocQuery {
   ///   private:
-  ///     const LiveIntervals &li;
+  ///     const LiveIntervals \&li;
   ///
   ///   public:
   ///     LinearScanRegallocQuery(LiveIntervals &intervals) 
-  ///         : li(intervals) {};
+  ///         : li(intervals) {}
   ///
   ///     /// This is pretty slow and conservative, but since linear scan
   ///     /// allocation doesn't pre-compute interference information it's
@@ -90,14 +85,14 @@ namespace llvm
   ///           interferences.insert(&iv->second);
   ///         }
   ///       }
-  ///     };
+  ///     }
   ///
   ///     /// This is *really* slow and stupid.  See above.
   ///     int getNumberOfInterferences(const LiveInterval &a) const {
   ///       IntervalSet intervals;
   ///       getInterferences(intervals, a);
-  ///       return(intervals.size());
-  ///     };
+  ///       return intervals.size();
+  ///     }
   ///   };  
   ///
   ///   In the allocator:
@@ -113,14 +108,14 @@ namespace llvm
   public:
     typedef SmallPtrSet<const LiveInterval *, 8> IntervalSet;
 
-    virtual ~RegallocQuery() {};
+    virtual ~RegallocQuery() {}
     
     /// Return whether two live ranges interfere.
     virtual bool interfere(const LiveInterval &a,
                            const LiveInterval &b) const {
       // A naive test
-      return(a.overlaps(b));
-    };
+      return a.overlaps(b);
+    }
 
     /// Return the set of intervals that interfere with this one.
     virtual void getInterferences(IntervalSet &interferences,
@@ -134,7 +129,7 @@ namespace llvm
     /// coalescing or other modifications.
     virtual void updateDataForMerge(const LiveInterval &a,
                                     const LiveInterval &b,
-                                    const MachineInstr &copy) {};
+                                    const MachineInstr &copy) {}
 
     /// Allow the register allocator to communicate when it doesn't
     /// want a copy coalesced.  This may be due to assumptions made by
@@ -143,7 +138,7 @@ namespace llvm
     /// about which copies to coalesce should be made by the
     /// coalescer.
     virtual bool isLegalToCoalesce(const MachineInstr &inst) const {
-      return(true);
+      return true;
     }
   };
 }