From: Chris Lattner
Date: Thu, 12 Sep 2002 19:06:51 +0000 (+0000)
Subject: Incorporate information about deleting instructions from a basic block,
X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4e1f96b1ee6d859633a3de4341450ee4beed7e38;p=oota-llvm.git
Incorporate information about deleting instructions from a basic block,
contributed by Tanya.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3692 91177308-0d34-0410-b5e6-96231b3b80d8
---
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index c81f89c39de..4415a873406 100644
--- a/docs/ProgrammersManual.html
+++ b/docs/ProgrammersManual.html
@@ -620,7 +620,7 @@ will create an AllocaInst instance that represents the
allocation of one integer in the current stack frame, at runtime.
Each Instruction subclass is likely to have varying default
parameters which change the semantics of the instruction, so refer to
-the doxygen documentation for
+the doxygen documentation for
the subclass of Instruction that you're interested in
instantiating.
@@ -701,7 +701,23 @@ instructions and adding them to BasicBlocks.
+Instructions
+
+Deleting an instruction from an existing sequence of instructions that form a BasicBlock is very straightforward. First, you
+must have a pointer to the instruction that you wish to delete. Second, you
+need to obtain the pointer to that instruction's basic block. You use the
+pointer to the basic block to get its list of instructions and then use the
+erase function to remove your instruction.
+
+For example:
+
+
+ Instruction *I = .. ;
+ BasicBlock *BB = I->getParent();
+ BB->getInstList().erase(I);
+
+