CLabel is an abstract type that supports the following operations:
Pretty printing
In a C file, does it need to be declared before use? (i.e. is it guaranteed to be already in scope in the places we need to refer to it?)
If it needs to be declared, what type (code or data) should it be declared to have?
Is it visible outside this object file or not?
Is it "dynamic" (see details below)
Eq and Ord, so that we can make sets of CLabels (currently only used in outputting C as far as I can tell, to avoid generating more than one declaration for any given label).
Converting an info table label into an entry label.
CLabel usage is a bit messy in GHC as they are used in a number of different contexts:
By the C-- AST to identify labels
By the unregisterised C code generator ("PprC") for naming functions (hence the name CLabel)
By the native and LLVM code generators to identify labels
For extra fun, each of these uses a slightly different subset of constructors
(e.g. AsmTempLabel and AsmTempDerivedLabel are used only in the NCG and
LLVM backends).
In general, we use IdLabel to represent Haskell things early in the
pipeline. However, later optimization passes will often represent blocks they
create with LocalBlockLabel where there is no obvious Name to hang off the
label.