Adds a compiler pass.
@api
CompilerPassInterface $pass A compiler pass:
string $type The type of compiler pass:
ContainerBuilder The current instance
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) {
if (null === $this->compiler) {
$this->compiler = new Compiler();
}
$this->compiler
->addPass($pass, $type);
$this
->addObjectResource($pass);
return $this;
}