Created
October 15, 2019 09:36
-
-
Save AndreasPK/302dd811ae0ac5d8c1e4278f77388067 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compiler\nativeGen\X86\CodeGen.hs:169:1: warning: [-Wincomplete-patterns] | |
Pattern match(es) are non-exhaustive | |
In an equation for `verifyBasicBlock': | |
Patterns not matched: _ :: [Instr] | |
| | |
169 | verifyBasicBlock instrs | |
-- Verifying basic blocks is cheap, but not cheap enough to enable it unconditionally. | |
verifyBasicBlock :: [Instr] -> () | |
verifyBasicBlock instrs | |
| debugIsOn = go False instrs | |
| not debugIsOn = () | |
where | |
go _ [] = () | |
go atEnd (i:instr) | |
= case i of | |
-- Start a new basic block | |
NEWBLOCK {} -> go False instr | |
-- Calls are not viable block terminators | |
CALL {} | atEnd -> faultyBlockWith i | |
| not atEnd -> go atEnd instr | |
-- All instructions ok, check if we reached the end and continue. | |
_ | not atEnd -> go (isJumpishInstr i) instr | |
-- Only jumps allowed at the end of basic blocks. | |
| otherwise -> if isJumpishInstr i | |
then go True instr | |
else faultyBlockWith i | |
faultyBlockWith i | |
= pprPanic "Non control flow instructions after end of basic block." | |
(ppr i <+> text "in:" $$ vcat (map ppr instrs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment