Revert GCStrategy ownership changes
authorPhilip Reames <listmail@philipreames.com>
Mon, 26 Jan 2015 18:26:35 +0000 (18:26 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 26 Jan 2015 18:26:35 +0000 (18:26 +0000)
commit2bdb23849bbbfd6335a4e41f528c01194d9750f5
tree00df0a5a343e46a2b1d593012b9e8ab23d89ffaf
parent019c097d1b3a826a504c84de6a5f48655be30266
Revert GCStrategy ownership changes

This change reverts the interesting parts of 226311 (and 227046).  This change introduced two problems, and I've been convinced that an alternate approach is preferrable anyways.

The bugs were:
- Registery appears to require all users be within the same linkage unit.  After this change, asking for "statepoint-example" in Transform/ would sometimes get you nullptr, whereas asking the same question in CodeGen would return the right GCStrategy.  The correct long term fix is to get rid of the utter hack which is Registry, but I don't have time for that right now.  227046 appears to have been an attempt to fix this, but I don't believe it does so completely.
- GCMetadataPrinter::finishAssembly was being called more than once per GCStrategy.  Each Strategy was being added to the GCModuleInfo multiple times.

Once I get time again, I'm going to split GCModuleInfo into the gc.root specific part and a GCStrategy owning Analysis pass.  I'm probably also going to kill off the Registry.  Once that's done, I'll move the new GCStrategyAnalysis and all built in GCStrategies into Analysis.  (As original suggested by Chandler.)  This will accomplish my original goal of being able to access GCStrategy from Transform/  without adding all of the builtin GCs to IR/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227109 91177308-0d34-0410-b5e6-96231b3b80d8
21 files changed:
include/llvm/CodeGen/GCMetadata.h
include/llvm/CodeGen/GCMetadataPrinter.h
include/llvm/CodeGen/GCStrategy.h [new file with mode: 0644]
include/llvm/IR/Function.h
include/llvm/IR/GCStrategy.h [deleted file]
lib/CodeGen/CMakeLists.txt
lib/CodeGen/ErlangGC.cpp
lib/CodeGen/GCMetadata.cpp
lib/CodeGen/GCRootLowering.cpp
lib/CodeGen/GCStrategy.cpp [new file with mode: 0644]
lib/CodeGen/OcamlGC.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
lib/CodeGen/ShadowStackGC.cpp
lib/CodeGen/StatepointExampleGC.cpp
lib/IR/CMakeLists.txt
lib/IR/Function.cpp
lib/IR/GCStrategy.cpp [deleted file]
lib/IR/LLVMContextImpl.cpp
lib/IR/LLVMContextImpl.h