2
0

ErlangGC.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #include "llvm/CodeGen/GCs.h"
  17. #include "llvm/CodeGen/GCStrategy.h"
  18. #include "llvm/CodeGen/MachineInstrBuilder.h"
  19. #include "llvm/MC/MCContext.h"
  20. #include "llvm/MC/MCSymbol.h"
  21. #include "llvm/Target/TargetInstrInfo.h"
  22. #include "llvm/Target/TargetMachine.h"
  23. #include "llvm/Target/TargetSubtargetInfo.h"
  24. using namespace llvm;
  25. namespace {
  26. class ErlangGC : public GCStrategy {
  27. public:
  28. ErlangGC();
  29. };
  30. }
  31. static GCRegistry::Add<ErlangGC> X("erlang",
  32. "erlang-compatible garbage collector");
  33. void llvm::linkErlangGC() {}
  34. ErlangGC::ErlangGC() {
  35. InitRoots = false;
  36. NeededSafePoints = 1 << GC::PostCall;
  37. UsesMetadata = true;
  38. CustomRoots = false;
  39. }