Adds a pass.
@api
CompilerPassInterface $pass A Compiler pass:
string $type The pass type:
InvalidArgumentException when a pass type doesn't exist
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION) {
$property = $type . 'Passes';
if (!isset($this->{$property})) {
throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type));
}
$passes =& $this->{$property};
$passes[] = $pass;
}