diff options
author | Philip Reames <listmail@philipreames.com> | 2014-12-09 23:57:54 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2014-12-09 23:57:54 +0000 |
commit | de226055ca2ca76a380b5ae110182097ac5e98e2 (patch) | |
tree | 3a9ed4dffaa7ea109cdba8bcc603e696293fbd8d /llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp | |
parent | 22600ff32878d72edf4eeb2c52139760fd443656 (diff) | |
download | bcm5719-llvm-de226055ca2ca76a380b5ae110182097ac5e98e2.tar.gz bcm5719-llvm-de226055ca2ca76a380b5ae110182097ac5e98e2.zip |
Remove the Module pointer from GCStrategy and GCMetadataPrinter
In the current implementation, GCStrategy is a part of the ownership structure for the gc metadata which describes a Module. It also contains a reference to the module in question. As a result, GCStrategy instances are essentially Module specific.
I plan to transition away from this design. Instead, a GCStrategy will be owned by the LLVMContext. It will be a lightweight policy object which contains no information about the Modules or Functions involved, but can be easily reached given a Function.
The first step in this transition is to remove the direct Module reference from GCStrategy. This also requires removing the single user of this reference, the GCMetadataPrinter hierarchy. In theory, this will allow the lifetime of the printers to be scoped to the LLVMContext as well, but in practice, I'm not actually changing that. (Yet?)
An alternate design would have been to move the direct Module reference into the GCMetadataPrinter and change the keying of the owning maps to explicitly key off both GCStrategy and Module. I'm open to doing it that way instead, but didn't see much value in preserving the per Module association for GCMetadataPrinters.
The next change in this sequence will be to start unwinding the intertwined ownership between GCStrategy, GCModuleInfo, and GCFunctionInfo.
Differential Revision: http://reviews.llvm.org/D6566
llvm-svn: 223859
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp index 5bda5a95fef..a1e9c4c358c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp @@ -36,8 +36,8 @@ namespace { class ErlangGCPrinter : public GCMetadataPrinter { public: - void beginAssembly(AsmPrinter &AP) override; - void finishAssembly(AsmPrinter &AP) override; + void beginAssembly(Module &M, AsmPrinter &AP) override; + void finishAssembly(Module &M, AsmPrinter &AP) override; }; } @@ -47,9 +47,9 @@ X("erlang", "erlang-compatible garbage collector"); void llvm::linkErlangGCPrinter() { } -void ErlangGCPrinter::beginAssembly(AsmPrinter &AP) { } +void ErlangGCPrinter::beginAssembly(Module &M, AsmPrinter &AP) { } -void ErlangGCPrinter::finishAssembly(AsmPrinter &AP) { +void ErlangGCPrinter::finishAssembly(Module &M, AsmPrinter &AP) { MCStreamer &OS = AP.OutStreamer; unsigned IntPtrSize = AP.TM.getSubtargetImpl()->getDataLayout()->getPointerSize(); |