Move ownership of GCStrategy objects to LLVMContext
[oota-llvm.git] / lib / CodeGen / ErlangGC.cpp
1 //===-- ErlangGC.cpp - Erlang/OTP GC strategy -------------------*- 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 // This file implements the Erlang/OTP runtime-compatible garbage collector
11 // (e.g. defines safe points, root initialization etc.)
12 //
13 // The frametable emitter is in ErlangGCPrinter.cpp.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #include "llvm/CodeGen/GCs.h"
18 #include "llvm/CodeGen/MachineInstrBuilder.h"
19 #include "llvm/IR/GCStrategy.h"
20 #include "llvm/MC/MCContext.h"
21 #include "llvm/MC/MCSymbol.h"
22 #include "llvm/Target/TargetInstrInfo.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include "llvm/Target/TargetSubtargetInfo.h"
25
26 using namespace llvm;
27
28 namespace {
29
30   class ErlangGC : public GCStrategy {
31   public:
32     ErlangGC();
33   };
34
35 }
36
37 static GCRegistry::Add<ErlangGC>
38 X("erlang", "erlang-compatible garbage collector");
39
40 void llvm::linkErlangGC() { }
41
42 ErlangGC::ErlangGC() {
43   InitRoots = false;
44   NeededSafePoints = 1 << GC::PostCall;
45   UsesMetadata = true;
46   CustomRoots = false;
47 }