OcamlGC.cpp 1017 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //===-- OcamlGC.cpp - Ocaml frametable GC strategy ------------------------===//
  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 lowering for the llvm.gc* intrinsics compatible with
  11. // Objective Caml 3.10.0, which uses a liveness-accurate static stack map.
  12. //
  13. // The frametable emitter is in OcamlGCPrinter.cpp.
  14. //
  15. //===----------------------------------------------------------------------===//
  16. #include "llvm/CodeGen/GCs.h"
  17. #include "llvm/CodeGen/GCStrategy.h"
  18. using namespace llvm;
  19. namespace {
  20. class VISIBILITY_HIDDEN OcamlGC : public GCStrategy {
  21. public:
  22. OcamlGC();
  23. };
  24. }
  25. static GCRegistry::Add<OcamlGC>
  26. X("ocaml", "ocaml 3.10-compatible GC");
  27. void llvm::linkOcamlGC() { }
  28. OcamlGC::OcamlGC() {
  29. NeededSafePoints = 1 << GC::PostCall;
  30. UsesMetadata = true;
  31. }