sslang-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

IR.MangleNames

Description

Mangle all variable names in a program to ensure global uniqueness.

Also populate symbol table with information about those (now unique) names.

This module also exports pickId, which other passes can use to create fresh variable names given some symbol table.

Synopsis

Documentation

normalizeId :: Identifiable i => i -> i Source #

Normalize an identifier (remove things like backticks etc.)

pickId :: Map MangledId t -> OriginId -> MangledId Source #

Given a symbol table and a name, pick a new name that is globally unique.