Re: Getting Rewrite Rules from ModGuts

2019-04-12 Thread Bill Hallahan
I figured out what was happening to the rules. In case anyone finds this thread later: rules for local functions do not go in the ModGuts or CgGuts, but are instead put in the IdInfo in individual Id's. A description of this is in the [Overall plumbing for rules] note in Rules:

Re: Getting Rewrite Rules from ModGuts

2019-04-12 Thread Bill Hallahan
Thanks Roland. Unfortunately, this also doesn't seem to work- I tried unsetting Opt_IgnoreInterfacePragmas both with and without setting Opt_EnableRewriteRules, and no combination results in the rules being loaded. Bill > On Apr 12, 2019, at 4:25 AM, Roland Senn wrote: > >

Re: Getting Rewrite Rules from ModGuts

2019-04-12 Thread Roland Senn
Hi Bill, You may try to set the DynFlag Opt_IgnoreInterfacePragmas to False. If set to True,, which is the default, GHC doesn't load a lot of optimization stuff. Good luck and kind regards Roland Am Donnerstag, den 11.04.2019, 23:02 -0400 schrieb Bill Hallahan: > Hi, > > I'm trying to use the

Re: Getting Rewrite Rules from ModGuts

2019-04-11 Thread Bill Hallahan
Thanks Brandon! Unfortunately, I don't think this is right (or at least it's not sufficient.) If I change the code to use:    _ <- setSessionDynFlags $ gopt_set flags Opt_EnableRewriteRulesI still read in 0 rewrite rules.(Unless I'm setting the wrong flag/not enough flags?)Bill Main.hs

Re: Getting Rewrite Rules from ModGuts

2019-04-11 Thread Brandon Allbery
You might need to enable optimization for RULES to get picked up at all. On Thu, Apr 11, 2019 at 11:03 PM Bill Hallahan wrote: > Hi, > > I'm trying to use the GHC API (8.2.2) to extract the rewrite rules from a > module, but have run into some difficulties. I've written the following > code

Getting Rewrite Rules from ModGuts

2019-04-11 Thread Bill Hallahan
Hi, I'm trying to use the GHC API (8.2.2) to extract the rewrite rules from a module, but have run into some difficulties. I've written the following code (all code is also attached as files): module Main where import GHC import GHC.Paths import HscTypes main :: IO ()