Spiller.h revision 40ac86f6b7bc1b60e66a29a29d292bf5d97ed611
1//===-- llvm/CodeGen/Spiller.h - Spiller -*- 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#ifndef LLVM_CODEGEN_SPILLER_H
11#define LLVM_CODEGEN_SPILLER_H
12
13#include <vector>
14
15namespace llvm {
16  struct LiveInterval;
17  class LiveIntervals;
18  class MachineFunction;
19  class VirtRegMap;
20
21  /// Spiller interface.
22  ///
23  /// Implementations are utility classes which insert spill or remat code on
24  /// demand.
25  class Spiller {
26  public:
27    virtual ~Spiller() = 0;
28    virtual std::vector<LiveInterval*> spill(LiveInterval *li) = 0;
29  };
30
31  /// Create and return a spiller object, as specified on the command line.
32  Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li,
33                         VirtRegMap *vrm);
34}
35
36#endif
37