Skip to content

Commit 45e9b47

Browse files
authored
Don't error on empty pass managers. (#488)
1 parent 2c32557 commit 45e9b47

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/newpm.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ Base.string(pm::NewPMPassManager) = "$(pm.type)($(join(pm.passes, ",")))"
5757

5858
function add!(f::Base.Callable, parent::AbstractPassManager, nested::AbstractPassManager)
5959
f(nested)
60-
if isempty(nested.passes)
61-
# LLVM errors when doing `module()` etc, so catch this early
62-
error("Cannot add an empty pass manager; did you forget to add passes?")
60+
if !isempty(nested.passes)
61+
add!(parent, nested)
6362
end
64-
add!(parent, nested)
6563
end
6664

6765
@doc (@doc NewPMPassManager)

0 commit comments

Comments
 (0)