blob: 730419b057ddfe001964838e956f8de8a6b621a9 [file] [log] [blame]
Lang Hamese2b201b2009-05-18 19:03:16 +00001//===-- 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 {
Bill Wendling76838062009-05-19 17:50:18 +000016 struct LiveInterval;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000017 class LiveIntervals;
18 class MachineFunction;
19 class VirtRegMap;
Lang Hamese2b201b2009-05-18 19:03:16 +000020
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;
Bill Wendling0bde89e2009-05-19 17:51:26 +000028 virtual std::vector<LiveInterval*> spill(LiveInterval *li) = 0;
Lang Hamese2b201b2009-05-18 19:03:16 +000029 };
30
31 /// Create and return a spiller object, as specified on the command line.
Bill Wendling0bde89e2009-05-19 17:51:26 +000032 Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li,
33 VirtRegMap *vrm);
Lang Hamese2b201b2009-05-18 19:03:16 +000034}
35
36#endif