summaryrefslogtreecommitdiff
path: root/lib/CodeGen/OcamlGC.cpp
blob: 88499cbd66827c175053f7e993a4d248b1320544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//===-- OcamlCollector.cpp - Ocaml frametable emitter ---------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements lowering for the llvm.gc* intrinsics compatible with
// Objective Caml 3.10.0, which uses a liveness-accurate static stack map.
//
//===----------------------------------------------------------------------===//
                        
#include "llvm/CodeGen/GCs.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/GCStrategy.h"
#include "llvm/Module.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"

using namespace llvm;

namespace {

  class VISIBILITY_HIDDEN OcamlCollector : public Collector {
  public:
    OcamlCollector();
  };
  
}

static CollectorRegistry::Add<OcamlCollector>
X("ocaml", "ocaml 3.10-compatible collector");

// -----------------------------------------------------------------------------

Collector *llvm::createOcamlCollector() {
  return new OcamlCollector();
}

OcamlCollector::OcamlCollector() {
  NeededSafePoints = 1 << GC::PostCall;
  UsesMetadata = true;
}