diff options
author | Tanya Lattner <tonic@nondot.org> | 2007-06-20 18:33:15 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2007-06-20 18:33:15 +0000 |
commit | 1a08cf311edae0976d127f76fc106e6c21ff79e0 (patch) | |
tree | badc081ed07f09b400199fea06c650994791ddfb /llvm/docs/ProgrammersManual.html | |
parent | b0714bb7bb8aa08aeaa2e874ff24b89a772f579e (diff) | |
download | bcm5719-llvm-1a08cf311edae0976d127f76fc106e6c21ff79e0.tar.gz bcm5719-llvm-1a08cf311edae0976d127f76fc106e6c21ff79e0.zip |
Add blurb on deleting global variables.
llvm-svn: 37674
Diffstat (limited to 'llvm/docs/ProgrammersManual.html')
-rw-r--r-- | llvm/docs/ProgrammersManual.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html index 347861e9638..571d4ba27af 100644 --- a/llvm/docs/ProgrammersManual.html +++ b/llvm/docs/ProgrammersManual.html @@ -106,6 +106,7 @@ use-def chains</a> </li> <li><a href="#schanges_deleting">Deleting <tt>Instruction</tt>s</a> </li> <li><a href="#schanges_replacing">Replacing an <tt>Instruction</tt> with another <tt>Value</tt></a> </li> + <li><a href="#schanges_deletingGV">Deleting <tt>GlobalVariable</tt>s</a> </li> </ul> </li> <!-- @@ -1878,6 +1879,31 @@ ReplaceInstWithValue, ReplaceInstWithInst --> </div> +<!--_______________________________________________________________________--> +<div class="doc_subsubsection"> + <a name="schanges_deletingGV">Deleting <tt>GlobalVariable</tt>s</a> +</div> + +<div class="doc_text"> + +<p>Deleting a global variable from a module is similar to deleting an +instruction. First, you must have a pointer to the global variable that you wish + to delete. Second, you must have a pointer to the module the global variable + belongs to. You use the pointer to the module to get its list of global + variables and then use the erase function to remove your global variable. + For example:</p> + +<div class="doc_code"> +<pre> +<a href="#GlobalVariable">GlobalVariable</a> *GV = .. ; +<a href="#Module">Module</a> *M = GV->getParent(); + +M->getGlobaleList().erase(GV); +</pre> +</div> + +</div> + <!-- *********************************************************************** --> <div class="doc_section"> <a name="advanced">Advanced Topics</a> |