-Collector::~Collector() {}
-
-void Collector::addLoweringPasses(FunctionPassManager &PM) const {
- if (NeedsDefaultLoweringPass())
- PM.add(new LowerIntrinsics(*this));
-
- if (NeedsCustomLoweringPass())
- PM.add(createCustomLoweringPass());
-}
-
-void Collector::addLoweringPasses(PassManager &PM) const {
- if (NeedsDefaultLoweringPass())
- PM.add(new LowerIntrinsics(*this));
-
- if (NeedsCustomLoweringPass())
- PM.add(createCustomLoweringPass());
-}
-
-void Collector::addGenericMachineCodePass(FunctionPassManager &PM,
- const TargetMachine &TM,
- bool Fast) const {
- if (needsSafePoints())
- PM.add(new MachineCodeAnalysis(*this, TM));
-}
-
-bool Collector::NeedsDefaultLoweringPass() const {
- // Default lowering is necessary only if read or write barriers have a default
- // action. The default for roots is no action.
- return !customWriteBarrier()
- || !customReadBarrier()
- || initializeRoots();
-}
-
-bool Collector::NeedsCustomLoweringPass() const {
- // Custom lowering is only necessary if enabled for some action.
- return customWriteBarrier()
- || customReadBarrier()
- || customRoots();