2008-08-18 02:44:35 +08:00
|
|
|
//===-- OcamlGC.cpp - Ocaml frametable GC strategy ------------------------===//
|
2008-08-17 20:56:54 +08:00
|
|
|
//
|
|
|
|
// 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.
|
2009-01-16 14:53:46 +08:00
|
|
|
//
|
2008-08-18 02:44:35 +08:00
|
|
|
// The frametable emitter is in OcamlGCPrinter.cpp.
|
2008-08-17 20:56:54 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-01-16 14:53:46 +08:00
|
|
|
|
2008-08-17 20:56:54 +08:00
|
|
|
#include "llvm/CodeGen/GCs.h"
|
|
|
|
#include "llvm/CodeGen/GCStrategy.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
2009-10-25 14:33:48 +08:00
|
|
|
class OcamlGC : public GCStrategy {
|
2008-08-17 20:56:54 +08:00
|
|
|
public:
|
2008-08-18 02:44:35 +08:00
|
|
|
OcamlGC();
|
2008-08-17 20:56:54 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2008-08-18 02:44:35 +08:00
|
|
|
static GCRegistry::Add<OcamlGC>
|
|
|
|
X("ocaml", "ocaml 3.10-compatible GC");
|
2008-08-17 20:56:54 +08:00
|
|
|
|
2008-08-18 02:44:35 +08:00
|
|
|
void llvm::linkOcamlGC() { }
|
2008-08-17 20:56:54 +08:00
|
|
|
|
2008-08-18 02:44:35 +08:00
|
|
|
OcamlGC::OcamlGC() {
|
2008-08-17 20:56:54 +08:00
|
|
|
NeededSafePoints = 1 << GC::PostCall;
|
|
|
|
UsesMetadata = true;
|
|
|
|
}
|