diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-10 03:18:06 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-10 03:18:06 +0000 |
commit | 80a75bfae980df96f969f1c05b0c4a80ce975240 (patch) | |
tree | b17b6964d35ffeaa66a62793e9cb123e67b69310 /docs | |
parent | afba8fe662d65b25b4baf46bb26cc18e1f9cc0a5 (diff) | |
download | llvm-80a75bfae980df96f969f1c05b0c4a80ce975240.tar.gz llvm-80a75bfae980df96f969f1c05b0c4a80ce975240.tar.bz2 llvm-80a75bfae980df96f969f1c05b0c4a80ce975240.tar.xz |
Adding a collector name attribute to Function in the IR. These
methods are new to Function:
bool hasCollector() const;
const std::string &getCollector() const;
void setCollector(const std::string &);
void clearCollector();
The assembly representation is as such:
define void @f() gc "shadow-stack" { ...
The implementation uses an on-the-side table to map Functions to
collector names, such that there is no overhead. A StringPool is
further used to unique collector names, which are extremely
likely to be unique per process.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.html | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index f85a441e53..80817e28dc 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -26,6 +26,7 @@ <li><a href="#functionstructure">Functions</a></li> <li><a href="#aliasstructure">Aliases</a> <li><a href="#paramattrs">Parameter Attributes</a></li> + <li><a href="#gc">Garbage Collector Names</a></li> <li><a href="#moduleasm">Module-Level Inline Assembly</a></li> <li><a href="#datalayout">Data Layout</a></li> </ol> @@ -702,15 +703,16 @@ an optional <a href="#linkage">linkage type</a>, an optional <a href="#paramattrs">parameter attribute</a> for the return type, a function name, a (possibly empty) argument list (each with optional <a href="#paramattrs">parameter attributes</a>), an optional section, an -optional alignment, an opening curly brace, a list of basic blocks, and a -closing curly brace. +optional alignment, an optional <a href="gc">garbage collector name</a>, an +opening curly brace, a list of basic blocks, and a closing curly brace. LLVM function declarations consist of the "<tt>declare</tt>" keyword, an optional <a href="#linkage">linkage type</a>, an optional <a href="#visibility">visibility style</a>, an optional <a href="#callingconv">calling convention</a>, a return type, an optional <a href="#paramattrs">parameter attribute</a> for the return type, a function -name, a possibly empty list of arguments, and an optional alignment.</p> +name, a possibly empty list of arguments, an optional alignment, and an optional +<a href="gc">garbage collector name</a>.</p> <p>A function definition contains a list of basic blocks, forming the CFG for the function. Each basic block may optionally start with a label (giving the @@ -826,6 +828,23 @@ declare i32 @atoi(i8*) nounwind readonly <!-- ======================================================================= --> <div class="doc_subsection"> + <a name="gc">Garbage Collector Names</a> +</div> + +<div class="doc_text"> +<p>Each function may specify a garbage collector name, which is simply a +string.</p> + +<div class="doc_code"><pre +>define void @f() gc "name" { ...</pre></div> + +<p>The compiler declares the supported values of <i>name</i>. Specifying a +collector which will cause the compiler to alter its output in order to support +the named garbage collection algorithm.</p> +</div> + +<!-- ======================================================================= --> +<div class="doc_subsection"> <a name="moduleasm">Module-Level Inline Assembly</a> </div> |