Modify deleting global variable with an even easier way.
authorTanya Lattner <tonic@nondot.org>
Wed, 20 Jun 2007 20:46:37 +0000 (20:46 +0000)
committerTanya Lattner <tonic@nondot.org>
Wed, 20 Jun 2007 20:46:37 +0000 (20:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37676 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ProgrammersManual.html

index 571d4ba27aff5b73c5fd0f52e8d4371d42a16df4..1f02fe699b5b35dc5856d8f9ff3cb4f32a6153a2 100644 (file)
@@ -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>