From 558ceec4c21f6dfb3f85298114f4b348523b2976 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 20 Nov 2008 14:17:11 +0000 Subject: [PATCH] Wired up the enabling and disabling of warnings --- pass/Pass.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pass/Pass.hs b/pass/Pass.hs index 0eb27e6..4a5f3bf 100644 --- a/pass/Pass.hs +++ b/pass/Pass.hs @@ -43,8 +43,11 @@ instance Die PassM where dieReport = throwError instance Warn PassM where - warnReport w = lift $ modify $ - \cs -> cs { csWarnings = csWarnings cs ++ [w] } + warnReport w@(_,t,_) = lift $ modify $ + \cs -> cs { csWarnings = + if t `Set.member` csEnabledWarnings cs + then csWarnings cs ++ [w] + else csWarnings cs } -- | The type of a pass function. -- This is as generic as possible. Passes are used on 'A.AST' in normal use,