+-- Partial ordering on phases: we want to know which phases will occur before
+-- which others. This is used for sanity checking, to ensure that the
+-- pipeline will stop at some point (see DriverPipeline.runPipeline).
+x `happensBefore` y
+ | x `elem` haskell_pipe = y `elem` tail (dropWhile (/= x) haskell_pipe)
+ | x `elem` c_pipe = y `elem` tail (dropWhile (/= x) c_pipe)
+ | otherwise = False
+
+haskell_pipe = [Unlit,Cpp,HsPp,Hsc,HCc,Mangle,As,Ln]
+c_pipe = [Cc,As,Ln]
+