Add %local-tag to external core output
authorJan Rochel <jan.rochel@stud.uka.de>
Sun, 2 Jul 2006 20:45:59 +0000 (20:45 +0000)
committerJan Rochel <jan.rochel@stud.uka.de>
Sun, 2 Jul 2006 20:45:59 +0000 (20:45 +0000)
commit99bab7d8385401ca552f6f161bd69d9d144f8309
tree4e57c7110bd5ad8fc8fd61910591d0f5a0ff75ae
parent4ce08e13864d000c599e1816b284b23ef16b2971
Add %local-tag to external core output

Hello, this is my first patch contributed to GHC. If there are any
inadequacies about it (maybe like this introductory disclaimer), please
let me know about it.

So, the need for this patch arose, while I was involved with processing
hcr files (external core output) and I noticed, that the output didn't
fully conform to the specification [1].
No %local-tags were used, which turned out to be a real nuisance as it
was not possible to determine which VDEFs can be erased in a further
optimization process and which ones are exported by the module.

Since the specification does not define the meaning of the %local-tag, I
assume, it makes sense, that it tags all functions, that are not
exported by the module.

The patch does not fully comply to the specification, as in my
implementation a local tag may appear before a VDEF but not before a
VDEFG.

[1] An External Representation for the GHC Core Language
    (DRAFT for GHC5.02), page 3, line 1

Greetings
Jan
compiler/coreSyn/ExternalCore.lhs
compiler/coreSyn/MkExternalCore.lhs
compiler/coreSyn/PprExternalCore.lhs
compiler/main/HscMain.lhs