88499cbd66827c175053f7e993a4d248b1320544
[oota-llvm.git] / lib / CodeGen / OcamlGC.cpp
1 //===-- OcamlCollector.cpp - Ocaml frametable emitter ---------------------===//
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 lowering for the llvm.gc* intrinsics compatible with
11 // Objective Caml 3.10.0, which uses a liveness-accurate static stack map.
12 //
13 //===----------------------------------------------------------------------===//
14                         
15 #include "llvm/CodeGen/GCs.h"
16 #include "llvm/CodeGen/AsmPrinter.h"
17 #include "llvm/CodeGen/GCStrategy.h"
18 #include "llvm/Module.h"
19 #include "llvm/Target/TargetAsmInfo.h"
20 #include "llvm/Target/TargetData.h"
21 #include "llvm/Target/TargetMachine.h"
22
23 using namespace llvm;
24
25 namespace {
26
27   class VISIBILITY_HIDDEN OcamlCollector : public Collector {
28   public:
29     OcamlCollector();
30   };
31   
32 }
33
34 static CollectorRegistry::Add<OcamlCollector>
35 X("ocaml", "ocaml 3.10-compatible collector");
36
37 // -----------------------------------------------------------------------------
38
39 Collector *llvm::createOcamlCollector() {
40   return new OcamlCollector();
41 }
42
43 OcamlCollector::OcamlCollector() {
44   NeededSafePoints = 1 << GC::PostCall;
45   UsesMetadata = true;
46 }