2013-03-25 21:47:46 +08: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-27 02:26:35 +08:00
|
|
|
#include "llvm/CodeGen/GCStrategy.h"
|
2015-02-13 17:09:03 +08:00
|
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
2013-03-25 21:47:46 +08:00
|
|
|
#include "llvm/MC/MCContext.h"
|
|
|
|
#include "llvm/MC/MCSymbol.h"
|
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2014-08-05 05:25:23 +08:00
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2013-03-25 21:47:46 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2015-01-17 07:16:12 +08:00
|
|
|
class ErlangGC : public GCStrategy {
|
|
|
|
public:
|
|
|
|
ErlangGC();
|
|
|
|
};
|
2013-03-25 21:47:46 +08:00
|
|
|
}
|
|
|
|
|
2015-01-17 07:16:12 +08:00
|
|
|
static GCRegistry::Add<ErlangGC> X("erlang",
|
|
|
|
"erlang-compatible garbage collector");
|
2013-03-25 21:47:46 +08:00
|
|
|
|
2015-01-17 07:16:12 +08:00
|
|
|
void llvm::linkErlangGC() {}
|
2013-03-25 21:47:46 +08:00
|
|
|
|
|
|
|
ErlangGC::ErlangGC() {
|
|
|
|
InitRoots = false;
|
|
|
|
NeededSafePoints = 1 << GC::PostCall;
|
|
|
|
UsesMetadata = true;
|
|
|
|
CustomRoots = false;
|
|
|
|
}
|