Skip to content

remove a no-warn directive from GHC.Cmm.ContFlowOpt

Curran McConnell requested to merge (removed):fix-no-warn-in-cmm into master

This patch is motivated by the desire to remove the {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} directive at the top of GHC.Cmm.ContFlowOpt. (Based on the text in this coding standards doc, I understand it's a goal of the project to remove such directives.) I chose this task because I'm a new contributor to GHC, and it seemed like a good way to get acquainted with the patching process.

In order to address the warning that arose when I removed the no-warn directive, I added a case to removeUnreachableBlocksProc to handle the CmmData constructor. Clearly, since this partial function has not been erroring out in the wild, its inputs are always in practice wrapped by the CmmProc constructor. I considered implementing type narrowing to witness this fact. But that seemed to overcomplicate things, seeing as the function is only ever called once.

By the way, let me know if I should open an issue for this patch. The contributors' guide says to open an issue for bugfixes & for new features, and this seems to me to be neither.

Merge request reports