blob: 17654a6ac3a20da74caf9e384e4c880df02ab91d [file] [log] [blame]
Gordon Henriksend930f912008-08-17 18:44:35 +00001//===-- OcamlGC.cpp - Ocaml frametable GC strategy ------------------------===//
Gordon Henriksenbcef14d2008-08-17 12:56:54 +00002//
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.
Mikhail Glushenkovb2f9a732009-01-16 06:53:46 +000012//
Gordon Henriksend930f912008-08-17 18:44:35 +000013// The frametable emitter is in OcamlGCPrinter.cpp.
Gordon Henriksenbcef14d2008-08-17 12:56:54 +000014//
15//===----------------------------------------------------------------------===//
Mikhail Glushenkovb2f9a732009-01-16 06:53:46 +000016
Gordon Henriksenbcef14d2008-08-17 12:56:54 +000017#include "llvm/CodeGen/GCs.h"
Philip Reames56a03932015-01-26 18:26:35 +000018#include "llvm/CodeGen/GCStrategy.h"
Gordon Henriksenbcef14d2008-08-17 12:56:54 +000019
20using namespace llvm;
21
22namespace {
Philip Reames36319532015-01-16 23:16:12 +000023class OcamlGC : public GCStrategy {
24public:
25 OcamlGC();
26};
Gordon Henriksenbcef14d2008-08-17 12:56:54 +000027}
28
Philip Reames36319532015-01-16 23:16:12 +000029static GCRegistry::Add<OcamlGC> X("ocaml", "ocaml 3.10-compatible GC");
Gordon Henriksenbcef14d2008-08-17 12:56:54 +000030
Philip Reames36319532015-01-16 23:16:12 +000031void llvm::linkOcamlGC() {}
Gordon Henriksenbcef14d2008-08-17 12:56:54 +000032
Gordon Henriksend930f912008-08-17 18:44:35 +000033OcamlGC::OcamlGC() {
Gordon Henriksenbcef14d2008-08-17 12:56:54 +000034 NeededSafePoints = 1 << GC::PostCall;
35 UsesMetadata = true;
36}