blob: ec2c2e8daf23715e9cb038aa1a18229bb51ec838 [file] [log] [blame]
Yiannis Tsiourisdbb4adf2013-03-25 13:47:46 +00001//===-- ErlangGC.cpp - Erlang/OTP GC strategy -------------------*- C++ -*-===//
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 the Erlang/OTP runtime-compatible garbage collector
11// (e.g. defines safe points, root initialization etc.)
12//
13// The frametable emitter is in ErlangGCPrinter.cpp.
14//
15//===----------------------------------------------------------------------===//
16
17#include "llvm/CodeGen/GCs.h"
Yiannis Tsiourisdbb4adf2013-03-25 13:47:46 +000018#include "llvm/CodeGen/MachineInstrBuilder.h"
Philip Reames2b453952015-01-16 20:07:33 +000019#include "llvm/IR/GCStrategy.h"
Yiannis Tsiourisdbb4adf2013-03-25 13:47:46 +000020#include "llvm/MC/MCContext.h"
21#include "llvm/MC/MCSymbol.h"
22#include "llvm/Target/TargetInstrInfo.h"
23#include "llvm/Target/TargetMachine.h"
Eric Christopherd9134482014-08-04 21:25:23 +000024#include "llvm/Target/TargetSubtargetInfo.h"
Yiannis Tsiourisdbb4adf2013-03-25 13:47:46 +000025
26using namespace llvm;
27
28namespace {
29
30 class ErlangGC : public GCStrategy {
Yiannis Tsiourisdbb4adf2013-03-25 13:47:46 +000031 public:
32 ErlangGC();
Yiannis Tsiourisdbb4adf2013-03-25 13:47:46 +000033 };
34
35}
36
37static GCRegistry::Add<ErlangGC>
38X("erlang", "erlang-compatible garbage collector");
39
40void llvm::linkErlangGC() { }
41
42ErlangGC::ErlangGC() {
43 InitRoots = false;
44 NeededSafePoints = 1 << GC::PostCall;
45 UsesMetadata = true;
46 CustomRoots = false;
Yiannis Tsiourisdbb4adf2013-03-25 13:47:46 +000047}