Yiannis Tsiouris | dbb4adf | 2013-03-25 13:47:46 +0000 | [diff] [blame] | 1 | //===-- 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" |
Philip Reames | 56a0393 | 2015-01-26 18:26:35 +0000 | [diff] [blame] | 18 | #include "llvm/CodeGen/GCStrategy.h" |
Chandler Carruth | 71f308a | 2015-02-13 09:09:03 +0000 | [diff] [blame] | 19 | #include "llvm/CodeGen/MachineInstrBuilder.h" |
Yiannis Tsiouris | dbb4adf | 2013-03-25 13:47:46 +0000 | [diff] [blame] | 20 | #include "llvm/MC/MCContext.h" |
| 21 | #include "llvm/MC/MCSymbol.h" |
| 22 | #include "llvm/Target/TargetInstrInfo.h" |
| 23 | #include "llvm/Target/TargetMachine.h" |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 24 | #include "llvm/Target/TargetSubtargetInfo.h" |
Yiannis Tsiouris | dbb4adf | 2013-03-25 13:47:46 +0000 | [diff] [blame] | 25 | |
| 26 | using namespace llvm; |
| 27 | |
| 28 | namespace { |
| 29 | |
Philip Reames | 3631953 | 2015-01-16 23:16:12 +0000 | [diff] [blame] | 30 | class ErlangGC : public GCStrategy { |
| 31 | public: |
| 32 | ErlangGC(); |
| 33 | }; |
Yiannis Tsiouris | dbb4adf | 2013-03-25 13:47:46 +0000 | [diff] [blame] | 34 | } |
| 35 | |
Philip Reames | 3631953 | 2015-01-16 23:16:12 +0000 | [diff] [blame] | 36 | static GCRegistry::Add<ErlangGC> X("erlang", |
| 37 | "erlang-compatible garbage collector"); |
Yiannis Tsiouris | dbb4adf | 2013-03-25 13:47:46 +0000 | [diff] [blame] | 38 | |
Philip Reames | 3631953 | 2015-01-16 23:16:12 +0000 | [diff] [blame] | 39 | void llvm::linkErlangGC() {} |
Yiannis Tsiouris | dbb4adf | 2013-03-25 13:47:46 +0000 | [diff] [blame] | 40 | |
| 41 | ErlangGC::ErlangGC() { |
| 42 | InitRoots = false; |
| 43 | NeededSafePoints = 1 << GC::PostCall; |
| 44 | UsesMetadata = true; |
| 45 | CustomRoots = false; |
Yiannis Tsiouris | dbb4adf | 2013-03-25 13:47:46 +0000 | [diff] [blame] | 46 | } |