blob: 88499cbd66827c175053f7e993a4d248b1320544 [file] [log] [blame]
Gordon Henriksen5a29c9e2008-08-17 12:56:54 +00001//===-- 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
23using namespace llvm;
24
25namespace {
26
27 class VISIBILITY_HIDDEN OcamlCollector : public Collector {
28 public:
29 OcamlCollector();
30 };
31
32}
33
34static CollectorRegistry::Add<OcamlCollector>
35X("ocaml", "ocaml 3.10-compatible collector");
36
37// -----------------------------------------------------------------------------
38
39Collector *llvm::createOcamlCollector() {
40 return new OcamlCollector();
41}
42
43OcamlCollector::OcamlCollector() {
44 NeededSafePoints = 1 << GC::PostCall;
45 UsesMetadata = true;
46}