aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2007-06-20 18:33:15 +0000
committerTanya Lattner <tonic@nondot.org>2007-06-20 18:33:15 +0000
commitb011c66da4412327619352f2b4a625b574b592b1 (patch)
tree665fb1df3753693ebd2e12fe3c79389395b9492f /docs
parent0304b2bc2bc3acaa4c6ff71816b69cc7c4b49997 (diff)
downloadexternal_llvm-b011c66da4412327619352f2b4a625b574b592b1.zip
external_llvm-b011c66da4412327619352f2b4a625b574b592b1.tar.gz
external_llvm-b011c66da4412327619352f2b4a625b574b592b1.tar.bz2
Add blurb on deleting global variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/ProgrammersManual.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index 347861e..571d4ba 100644
--- a/docs/ProgrammersManual.html
+++ b/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-&gt;getParent();
+
+M-&gt;getGlobaleList().erase(GV);
+</pre>
+</div>
+
+</div>
+
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="advanced">Advanced Topics</a>