Closed dcbaker closed 2 years ago
We need a constant propagation and folding transformation pass to handle non-trivial programs.
we need to be able to take Meson DSL like:
srcs = files('a.cpp', 'b.cpp') if host_machine.system() == 'windows' srcs += files('windows.cpp') else srcs += files('posix.cpp') endif executable( exe, srcs, )``` Since we can first resolve the if statement using passes that already exist: ```meson srcs = files('a.cpp', 'b.cpp') srcs += files('posix.cpp') executable( exe, srcs, )``` Then we can do constant folding: ```meson srcs = files('a.cpp', 'b.cpp', 'posix.cpp') executable( exe, srcs, )``` then finally propogation: ```meson executable( exe, files('a.cpp', 'b.cpp', 'posix.cpp'), )```
We need a constant propagation and folding transformation pass to handle non-trivial programs.
we need to be able to take Meson DSL like: