2013-03-25 13:47:46 +00:00
|
|
|
//===-- ErlangGC.cpp - Erlang/OTP GC strategy -------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the Erlang/OTP runtime-compatible garbage collector
|
|
|
|
// (e.g. defines safe points, root initialization etc.)
|
|
|
|
//
|
|
|
|
// The frametable emitter is in ErlangGCPrinter.cpp.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "llvm/CodeGen/GCs.h"
|
2015-01-26 18:26:35 +00:00
|
|
|
#include "llvm/CodeGen/GCStrategy.h"
|
2015-02-13 09:09:03 +00:00
|
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
2013-03-25 13:47:46 +00:00
|
|
|
#include "llvm/MC/MCContext.h"
|
|
|
|
#include "llvm/MC/MCSymbol.h"
|
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2014-08-04 21:25:23 +00:00
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2013-03-25 13:47:46 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2015-01-16 23:16:12 +00:00
|
|
|
class ErlangGC : public GCStrategy {
|
|
|
|
public:
|
|
|
|
ErlangGC();
|
|
|
|
};
|
2013-03-25 13:47:46 +00:00
|
|
|
}
|
|
|
|
|
2015-01-16 23:16:12 +00:00
|
|
|
static GCRegistry::Add<ErlangGC> X("erlang",
|
|
|
|
"erlang-compatible garbage collector");
|
2013-03-25 13:47:46 +00:00
|
|
|
|
2015-01-16 23:16:12 +00:00
|
|
|
void llvm::linkErlangGC() {}
|
2013-03-25 13:47:46 +00:00
|
|
|
|
|
|
|
ErlangGC::ErlangGC() {
|
|
|
|
InitRoots = false;
|
|
|
|
NeededSafePoints = 1 << GC::PostCall;
|
|
|
|
UsesMetadata = true;
|
|
|
|
CustomRoots = false;
|
|
|
|
}
|