blob: cad054d744c4a7cf6fe2dcba1cada7bad1e9a8f1 [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 {
Lang Hamesf41538d2009-06-02 16:53:25 +000016 class LiveInterval;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000017 class LiveIntervals;
Lang Hamesf41538d2009-06-02 16:53:25 +000018 class LiveStacks;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000019 class MachineFunction;
20 class VirtRegMap;
Lang Hamese2b201b2009-05-18 19:03:16 +000021
22 /// Spiller interface.
23 ///
24 /// Implementations are utility classes which insert spill or remat code on
25 /// demand.
26 class Spiller {
27 public:
28 virtual ~Spiller() = 0;
Bill Wendling0bde89e2009-05-19 17:51:26 +000029 virtual std::vector<LiveInterval*> spill(LiveInterval *li) = 0;
Lang Hamese2b201b2009-05-18 19:03:16 +000030 };
31
32 /// Create and return a spiller object, as specified on the command line.
Bill Wendling0bde89e2009-05-19 17:51:26 +000033 Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li,
Lang Hamesf41538d2009-06-02 16:53:25 +000034 LiveStacks *ls, VirtRegMap *vrm);
Lang Hamese2b201b2009-05-18 19:03:16 +000035}
36
37#endif