[MLton] modifying flatten.fun to always flatten
Lukasz S Ziarek
Tue, 20 Jan 2004 10:48:29 -0500 (EST)
On Tue, 20 Jan 2004, Matthew Fluet wrote:
> > > > I ran into acouple problems adopting the first approach, so I have
> > > > implimented the second approach. It seems to be doing what I need it to do
> > > > and the compiler fixpoints. I would like to know if there is a way to
> > > > print the ssa tree to a file before and after the flatten pass. Bassically
> > > > I just want to double check I am correctly flattening all tupples.
> > >
> > > -keep-pass flatten will leave you with z.flatten.pre.ssa and
> > > z.flatten.post.ssa. The argument to -keep-pass is actually a regular
> > > expression (useful for the passes that are run more than once). Compiling
> > > with -show-types true will probably also be useful to you; you'll be
> > > able to search for * types in the post.ssa.
> > I add these arguments to the flags in the Makefile, correct? Do you
> > offhand know where the default location for the generated files will be?
> > /build/bin? I did not realize -type-check true generated a file.
> Sorry, I was a little unclear. If you have z.sml, and you compile with:
> mlton -keep-pass flatten -show-types true z.sml
> then, in addition to the executable z, you will have z.flatten.pre.ssa and
> z.flatten.post.ssa in the current directory. -show-types true by itself
> doesn't generate any files, it just influences whether or not types appear
> when printing the ILs.
> So, you shouldn't need to add then to the Makefile, unless you want to see
> the ILs for a self-compile.
You are are correct, I was looking for a way to grab those files from the
self compile as well as just for a regular .sml file. Once I am satisfied
my code does what I want in my test cases, I figured seeing what it does
to the entire compiler would quickly show if there were any quirky bugs
since it is a large code base.
> MLton mailing list