summaryrefslogtreecommitdiffstats
path: root/llvm/docs/ProgrammersManual.html
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2007-06-20 20:46:37 +0000
committerTanya Lattner <tonic@nondot.org>2007-06-20 20:46:37 +0000
commit872bf1bdc331b8b00031e53fefe2297165bc3f1b (patch)
tree6bc5fd6ca8494750ffc665385cb374b6bbb00349 /llvm/docs/ProgrammersManual.html
parenteeff910244b0955d916dd704492e2bdf6de5f1b9 (diff)
downloadbcm5719-llvm-872bf1bdc331b8b00031e53fefe2297165bc3f1b.tar.gz
bcm5719-llvm-872bf1bdc331b8b00031e53fefe2297165bc3f1b.zip
Modify deleting global variable with an even easier way.
llvm-svn: 37676
Diffstat (limited to 'llvm/docs/ProgrammersManual.html')
-rw-r--r--llvm/docs/ProgrammersManual.html11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html
index 571d4ba27af..1f02fe699b5 100644
--- a/llvm/docs/ProgrammersManual.html
+++ b/llvm/docs/ProgrammersManual.html
@@ -1886,19 +1886,16 @@ ReplaceInstWithValue, ReplaceInstWithInst -->
<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.
+<p>Deleting a global variable from a module is just as easy as deleting an
+Instruction. First, you must have a pointer to the global variable that you wish
+ to delete. You use this pointer to erase it from its parent, the module.
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);
+GV-&gt;eraseFromParent();
</pre>
</div>
OpenPOWER on IntegriCloud