Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2785

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>CgExtCode</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_CgExtCode.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ghc-7.4.2: The GHC API</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">CgExtCode</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Our extended FCode monad.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">newtype</span>  <a href="#t:ExtFCode">ExtFCode</a> a = <a href="#v:EC">EC</a> {<ul class="subs"><li><a href="#v:unEC">unEC</a> :: <a href="CgExtCode.html#t:Env">Env</a> -&gt; Decls -&gt; <a href="CgMonad.html#t:FCode">FCode</a> (Decls, a)</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:ExtCode">ExtCode</a> = <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</li><li class="src short"><span class="keyword">data</span>  <a href="#t:Named">Named</a> <ul class="subs"><li>= <a href="#v:VarN">VarN</a> <a href="CmmExpr.html#t:CmmExpr">CmmExpr</a>  </li><li>| <a href="#v:FunN">FunN</a> <a href="Module.html#t:PackageId">PackageId</a>  </li><li>| <a href="#v:LabelN">LabelN</a> <a href="BlockId.html#t:BlockId">BlockId</a>  </li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Env">Env</a> = <a href="UniqFM.html#t:UniqFM">UniqFM</a> <a href="CgExtCode.html#t:Named">Named</a></li><li class="src short"><a href="#v:loopDecls">loopDecls</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a</li><li class="src short"><a href="#v:getEnv">getEnv</a> :: <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CgExtCode.html#t:Env">Env</a></li><li class="src short"><a href="#v:newLocal">newLocal</a> :: <a href="CmmType.html#t:CmmType">CmmType</a> -&gt; <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CmmExpr.html#t:LocalReg">LocalReg</a></li><li class="src short"><a href="#v:newLabel">newLabel</a> :: <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="BlockId.html#t:BlockId">BlockId</a></li><li class="src short"><a href="#v:newFunctionName">newFunctionName</a> :: <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="Module.html#t:PackageId">PackageId</a> -&gt; <a href="CgExtCode.html#t:ExtCode">ExtCode</a></li><li class="src short"><a href="#v:newImport">newImport</a> :: (<a href="FastString.html#t:FastString">FastString</a>, <a href="CLabel.html#t:CLabel">CLabel</a>) -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</li><li class="src short"><a href="#v:lookupLabel">lookupLabel</a> :: <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="BlockId.html#t:BlockId">BlockId</a></li><li class="src short"><a href="#v:lookupName">lookupName</a> :: <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CmmExpr.html#t:CmmExpr">CmmExpr</a></li><li class="src short"><a href="#v:code">code</a> ::  <a href="CgMonad.html#t:FCode">FCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a</li><li class="src short"><a href="#v:code2">code2</a> ::  (<a href="CgMonad.html#t:FCode">FCode</a> (Decls, b) -&gt; <a href="CgMonad.html#t:FCode">FCode</a> ((Decls, b), c)) -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> b -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> c</li><li class="src short"><a href="#v:nopEC">nopEC</a> :: <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</li><li class="src short"><a href="#v:stmtEC">stmtEC</a> :: <a href="OldCmm.html#t:CmmStmt">CmmStmt</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</li><li class="src short"><a href="#v:stmtsEC">stmtsEC</a> :: [<a href="OldCmm.html#t:CmmStmt">CmmStmt</a>] -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</li><li class="src short"><a href="#v:getCgStmtsEC">getCgStmtsEC</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CgMonad.html#t:CgStmts">CgStmts</a></li><li class="src short"><a href="#v:getCgStmtsEC-39-">getCgStmtsEC'</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> (a, <a href="CgMonad.html#t:CgStmts">CgStmts</a>)</li><li class="src short"><a href="#v:forkLabelledCodeEC">forkLabelledCodeEC</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="BlockId.html#t:BlockId">BlockId</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">newtype</span>  <a name="t:ExtFCode" class="def">ExtFCode</a> a </p><div class="doc"><p>Does a computation in the FCode monad, with a current environment
	and a list of local declarations. Returns the resulting list of declarations.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:EC" class="def">EC</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:unEC" class="def">unEC</a> :: <a href="CgExtCode.html#t:Env">Env</a> -&gt; Decls -&gt; <a href="CgMonad.html#t:FCode">FCode</a> (Decls, a)</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ExtFCode" class="caption collapser" onclick="toggleSection('i:ExtFCode')">Instances</p><div id="section.i:ExtFCode" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Control-Monad.html#t:Monad">Monad</a> <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ExtCode" class="def">ExtCode</a> = <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</p></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Named" class="def">Named</a>  </p><div class="doc"><p>The environment contains variable definitions or blockids.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:VarN" class="def">VarN</a> <a href="CmmExpr.html#t:CmmExpr">CmmExpr</a></td><td class="doc"><p>Holds CmmLit(CmmLabel ..) which gives the label type,
	eg, RtsLabel, ForeignLabel, CmmLabel etc. 
</p></td></tr><tr><td class="src"><a name="v:FunN" class="def">FunN</a> <a href="Module.html#t:PackageId">PackageId</a></td><td class="doc"><p>A function name from this package
</p></td></tr><tr><td class="src"><a name="v:LabelN" class="def">LabelN</a> <a href="BlockId.html#t:BlockId">BlockId</a></td><td class="doc"><p>A blockid of some code or data.
</p></td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Env" class="def">Env</a> = <a href="UniqFM.html#t:UniqFM">UniqFM</a> <a href="CgExtCode.html#t:Named">Named</a></p><div class="doc"><p>An environment of named things.
</p></div></div><div class="top"><p class="src"><a name="v:loopDecls" class="def">loopDecls</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a</p><div class="doc"><p>Takes the variable decarations and imports from the monad
 	and makes an environment, which is looped back into the computation.  
	In this way, we can have embedded declarations that scope over the whole
 	procedure, and imports that scope over the entire module.
	Discards the local declaration contained within decl'
</p></div></div><div class="top"><p class="src"><a name="v:getEnv" class="def">getEnv</a> :: <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CgExtCode.html#t:Env">Env</a></p><div class="doc"><p>Get the current environment from the monad.
</p></div></div><div class="top"><p class="src"><a name="v:newLocal" class="def">newLocal</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="CmmType.html#t:CmmType">CmmType</a></td><td class="doc"><p>data type
</p></td></tr><tr><td class="src">-&gt; <a href="FastString.html#t:FastString">FastString</a></td><td class="doc"><p>name of variable
</p></td></tr><tr><td class="src">-&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CmmExpr.html#t:LocalReg">LocalReg</a></td><td class="doc"><p>register holding the value
</p></td></tr></table></div><div class="doc"><p>Create a fresh local variable of a given type.
</p></div></div><div class="top"><p class="src"><a name="v:newLabel" class="def">newLabel</a> :: <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="BlockId.html#t:BlockId">BlockId</a></p><div class="doc"><p>Allocate a fresh label.
</p></div></div><div class="top"><p class="src"><a name="v:newFunctionName" class="def">newFunctionName</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="FastString.html#t:FastString">FastString</a></td><td class="doc"><p>name of the function 
</p></td></tr><tr><td class="src">-&gt; <a href="Module.html#t:PackageId">PackageId</a></td><td class="doc"><p>package of the current module
</p></td></tr><tr><td class="src">-&gt; <a href="CgExtCode.html#t:ExtCode">ExtCode</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Add add a local function to the environment.
</p></div></div><div class="top"><p class="src"><a name="v:newImport" class="def">newImport</a> :: (<a href="FastString.html#t:FastString">FastString</a>, <a href="CLabel.html#t:CLabel">CLabel</a>) -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</p><div class="doc"><p>Add an imported foreign label to the list of local declarations.
	If this is done at the start of the module the declaration will scope
	over the whole module.
</p></div></div><div class="top"><p class="src"><a name="v:lookupLabel" class="def">lookupLabel</a> :: <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="BlockId.html#t:BlockId">BlockId</a></p><div class="doc"><p>Lookup the BlockId bound to the label with this name.
	If one hasn't been bound yet, create a fresh one based on the 
	Unique of the name.
</p></div></div><div class="top"><p class="src"><a name="v:lookupName" class="def">lookupName</a> :: <a href="FastString.html#t:FastString">FastString</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CmmExpr.html#t:CmmExpr">CmmExpr</a></p><div class="doc"><p>Lookup the location of a named variable.
	Unknown names are treated as if they had been 'import'ed from the runtime system.
 	This saves us a lot of bother in the RTS sources, at the expense of
 	deferring some errors to link time.
</p></div></div><div class="top"><p class="src"><a name="v:code" class="def">code</a> ::  <a href="CgMonad.html#t:FCode">FCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a</p><div class="doc"><p>Lift an FCode computation into the ExtFCode monad
</p></div></div><div class="top"><p class="src"><a name="v:code2" class="def">code2</a> ::  (<a href="CgMonad.html#t:FCode">FCode</a> (Decls, b) -&gt; <a href="CgMonad.html#t:FCode">FCode</a> ((Decls, b), c)) -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> b -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> c</p></div><div class="top"><p class="src"><a name="v:nopEC" class="def">nopEC</a> :: <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</p><div class="doc"><p>Do nothing in the ExtFCode monad.
</p></div></div><div class="top"><p class="src"><a name="v:stmtEC" class="def">stmtEC</a> :: <a href="OldCmm.html#t:CmmStmt">CmmStmt</a> -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</p><div class="doc"><p>Accumulate a CmmStmt into the monad state.
</p></div></div><div class="top"><p class="src"><a name="v:stmtsEC" class="def">stmtsEC</a> :: [<a href="OldCmm.html#t:CmmStmt">CmmStmt</a>] -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> ()</p><div class="doc"><p>Accumulate some CmmStmts into the monad state.
</p></div></div><div class="top"><p class="src"><a name="v:getCgStmtsEC" class="def">getCgStmtsEC</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="CgMonad.html#t:CgStmts">CgStmts</a></p><div class="doc"><p>Get the generated statements out of the monad state.
</p></div></div><div class="top"><p class="src"><a name="v:getCgStmtsEC-39-" class="def">getCgStmtsEC'</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> (a, <a href="CgMonad.html#t:CgStmts">CgStmts</a>)</p><div class="doc"><p>Get the generated statements, and the return value out of the monad state.
</p></div></div><div class="top"><p class="src"><a name="v:forkLabelledCodeEC" class="def">forkLabelledCodeEC</a> ::  <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> a -&gt; <a href="CgExtCode.html#t:ExtFCode">ExtFCode</a> <a href="BlockId.html#t:BlockId">BlockId</a></p><div class="doc"><p>Emit a chunk of code outside the instruction stream, 
	and return its block id. 
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>