Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Alex D
GHC
Commits
030d9d47
Commit
030d9d47
authored
Nov 28, 2017
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLabel: A bit of documentation
parent
d3b80c79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
compiler/cmm/CLabel.hs
compiler/cmm/CLabel.hs
+25
-3
No files found.
compiler/cmm/CLabel.hs
View file @
030d9d47
...
...
@@ -130,8 +130,8 @@ import PprCore ( {- instances -} )
-- -----------------------------------------------------------------------------
-- The CLabel type
{-
|
CLabel is an abstract type that supports the following operations:
{-
|
'
CLabel
'
is an abstract type that supports the following operations:
- Pretty printing
...
...
@@ -150,6 +150,25 @@ import PprCore ( {- instances -} )
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.
-}
data
CLabel
...
...
@@ -193,10 +212,13 @@ data CLabel
FunctionOrData
-- | Local temporary label used for native (or LLVM) code generation
-- | Local temporary label used for native (or LLVM) code generation; must not
-- appear outside of these contexts. Use primarily for debug information
|
AsmTempLabel
{-# UNPACK #-}
!
Unique
-- | A label \"derived\" from another 'CLabel' by the addition of a suffix.
-- Must not occur outside of the NCG or LLVM code generators.
|
AsmTempDerivedLabel
CLabel
FastString
-- suffix
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment