diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 18:44:35 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 18:44:35 +0000 |
commit | 5eca075b74d62c621b160aa216b4cd50829a2cc7 (patch) | |
tree | 5406e0182a3a20726e00eec044bbca1199e673b9 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 94fb5f2a7066c427a9d3dac10a33ccbd02aac467 (diff) |
Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:
Collector -> GCStrategy
CollectorMetadata -> GCFunctionInfo
CollectorModuleMetadata -> GCModuleInfo
CollectorRegistry -> GCRegistry
Function::getCollector -> getGC (setGC, hasGC, clearGC)
Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 012e7d0992..f4e31f727e 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -27,6 +27,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/ParameterAttributes.h" #include "llvm/CodeGen/GCStrategy.h" +#include "llvm/CodeGen/GCMetadata.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" @@ -601,15 +602,15 @@ public: /// FunctionLoweringInfo &FuncInfo; - /// GCI - Garbage collection metadata for the function. - CollectorMetadata *GCI; + /// GFI - Garbage collection metadata for the function. + GCFunctionInfo *GFI; SelectionDAGLowering(SelectionDAG &dag, TargetLowering &tli, AliasAnalysis &aa, FunctionLoweringInfo &funcinfo, - CollectorMetadata *gci) + GCFunctionInfo *gfi) : TLI(tli), DAG(dag), TD(DAG.getTarget().getTargetData()), AA(aa), - FuncInfo(funcinfo), GCI(gci) { + FuncInfo(funcinfo), GFI(gfi) { } /// getRoot - Return the current virtual root of the Selection DAG, @@ -3485,18 +3486,18 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { } case Intrinsic::gcroot: - if (GCI) { + if (GFI) { Value *Alloca = I.getOperand(1); Constant *TypeMap = cast<Constant>(I.getOperand(2)); FrameIndexSDNode *FI = cast<FrameIndexSDNode>(getValue(Alloca).Val); - GCI->addStackRoot(FI->getIndex(), TypeMap); + GFI->addStackRoot(FI->getIndex(), TypeMap); } return 0; case Intrinsic::gcread: case Intrinsic::gcwrite: - assert(0 && "Collector failed to lower gcread/gcwrite intrinsics!"); + assert(0 && "GC failed to lower gcread/gcwrite intrinsics!"); return 0; case Intrinsic::flt_rounds: { @@ -4878,7 +4879,7 @@ unsigned SelectionDAGISel::MakeReg(MVT VT) { void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<AliasAnalysis>(); - AU.addRequired<CollectorModuleMetadata>(); + AU.addRequired<GCModuleInfo>(); AU.setPreservesAll(); } @@ -4887,10 +4888,10 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { AA = &getAnalysis<AliasAnalysis>(); MachineFunction &MF = MachineFunction::construct(&Fn, TLI.getTargetMachine()); - if (MF.getFunction()->hasCollector()) - GCI = &getAnalysis<CollectorModuleMetadata>().get(*MF.getFunction()); + if (MF.getFunction()->hasGC()) + GFI = &getAnalysis<GCModuleInfo>().getFunctionInfo(*MF.getFunction()); else - GCI = 0; + GFI = 0; RegInfo = &MF.getRegInfo(); DOUT << "\n\n\n=== " << Fn.getName() << "\n"; @@ -5089,7 +5090,7 @@ static void CheckDAGForTailCallsAndFixThem(SelectionDAG &DAG, void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB, std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate, FunctionLoweringInfo &FuncInfo) { - SelectionDAGLowering SDL(DAG, TLI, *AA, FuncInfo, GCI); + SelectionDAGLowering SDL(DAG, TLI, *AA, FuncInfo, GFI); // Lower any arguments needed in this block if this is the entry block. if (LLVMBB == &LLVMBB->getParent()->getEntryBlock()) @@ -5504,7 +5505,7 @@ SelectionDAGISel::FinishBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, getAnalysisToUpdate<MachineModuleInfo>(), NodeAllocator); CurDAG = &HSDAG; - SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI); + SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GFI); // Set the current basic block to the mbb we wish to insert the code into BB = BitTestCases[i].Parent; HSDL.setCurrentBasicBlock(BB); @@ -5519,7 +5520,7 @@ SelectionDAGISel::FinishBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, getAnalysisToUpdate<MachineModuleInfo>(), NodeAllocator); CurDAG = &BSDAG; - SelectionDAGLowering BSDL(BSDAG, TLI, *AA, FuncInfo, GCI); + SelectionDAGLowering BSDL(BSDAG, TLI, *AA, FuncInfo, GFI); // Set the current basic block to the mbb we wish to insert the code into BB = BitTestCases[i].Cases[j].ThisBB; BSDL.setCurrentBasicBlock(BB); @@ -5578,7 +5579,7 @@ SelectionDAGISel::FinishBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, getAnalysisToUpdate<MachineModuleInfo>(), NodeAllocator); CurDAG = &HSDAG; - SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI); + SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GFI); // Set the current basic block to the mbb we wish to insert the code into BB = JTCases[i].first.HeaderBB; HSDL.setCurrentBasicBlock(BB); @@ -5592,7 +5593,7 @@ SelectionDAGISel::FinishBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, getAnalysisToUpdate<MachineModuleInfo>(), NodeAllocator); CurDAG = &JSDAG; - SelectionDAGLowering JSDL(JSDAG, TLI, *AA, FuncInfo, GCI); + SelectionDAGLowering JSDL(JSDAG, TLI, *AA, FuncInfo, GFI); // Set the current basic block to the mbb we wish to insert the code into BB = JTCases[i].second.MBB; JSDL.setCurrentBasicBlock(BB); @@ -5642,7 +5643,7 @@ SelectionDAGISel::FinishBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, getAnalysisToUpdate<MachineModuleInfo>(), NodeAllocator); CurDAG = &SDAG; - SelectionDAGLowering SDL(SDAG, TLI, *AA, FuncInfo, GCI); + SelectionDAGLowering SDL(SDAG, TLI, *AA, FuncInfo, GFI); // Set the current basic block to the mbb we wish to insert the code into BB = SwitchCases[i].ThisBB; |