diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 12:56:54 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 12:56:54 +0000 |
commit | bcef14d2e4b2c92e767007a3f474985ba1a4754f (patch) | |
tree | 13759f0625e5bc14dcd2d4fbc0238066795e0b32 /llvm/lib/CodeGen/OcamlGC.cpp | |
parent | dbe06d3b69cab1ae6e708f5eca69cb0538a09842 (diff) | |
download | bcm5719-llvm-bcef14d2e4b2c92e767007a3f474985ba1a4754f.tar.gz bcm5719-llvm-bcef14d2e4b2c92e767007a3f474985ba1a4754f.zip |
Factor GC metadata table assembly generation out of Collector in preparation for splitting AsmPrinter into its own library.
llvm-svn: 54881
Diffstat (limited to 'llvm/lib/CodeGen/OcamlGC.cpp')
-rw-r--r-- | llvm/lib/CodeGen/OcamlGC.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/OcamlGC.cpp b/llvm/lib/CodeGen/OcamlGC.cpp new file mode 100644 index 00000000000..88499cbd668 --- /dev/null +++ b/llvm/lib/CodeGen/OcamlGC.cpp @@ -0,0 +1,46 @@ +//===-- OcamlCollector.cpp - Ocaml frametable emitter ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements lowering for the llvm.gc* intrinsics compatible with +// Objective Caml 3.10.0, which uses a liveness-accurate static stack map. +// +//===----------------------------------------------------------------------===// + +#include "llvm/CodeGen/GCs.h" +#include "llvm/CodeGen/AsmPrinter.h" +#include "llvm/CodeGen/GCStrategy.h" +#include "llvm/Module.h" +#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetData.h" +#include "llvm/Target/TargetMachine.h" + +using namespace llvm; + +namespace { + + class VISIBILITY_HIDDEN OcamlCollector : public Collector { + public: + OcamlCollector(); + }; + +} + +static CollectorRegistry::Add<OcamlCollector> +X("ocaml", "ocaml 3.10-compatible collector"); + +// ----------------------------------------------------------------------------- + +Collector *llvm::createOcamlCollector() { + return new OcamlCollector(); +} + +OcamlCollector::OcamlCollector() { + NeededSafePoints = 1 << GC::PostCall; + UsesMetadata = true; +} |