[llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Function.h GlobalVariable.h Instruction.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Oct 11 15:21:27 PDT 2004
Changes in directory llvm/include/llvm:
BasicBlock.h updated: 1.42 -> 1.43
Function.h updated: 1.52 -> 1.53
GlobalVariable.h updated: 1.28 -> 1.29
Instruction.h updated: 1.60 -> 1.61
---
Log message:
Add long overdue methods
---
Diffs of the changes: (+45 -2)
Index: llvm/include/llvm/BasicBlock.h
diff -u llvm/include/llvm/BasicBlock.h:1.42 llvm/include/llvm/BasicBlock.h:1.43
--- llvm/include/llvm/BasicBlock.h:1.42 Wed Sep 1 17:55:34 2004
+++ llvm/include/llvm/BasicBlock.h Mon Oct 11 17:21:13 2004
@@ -95,6 +95,18 @@
TerminatorInst *getTerminator();
const TerminatorInst *const getTerminator() const;
+ /// removeFromParent - This method unlinks 'this' from the containing
+ /// function, but does not delete it.
+ ///
+ void removeFromParent();
+
+ /// eraseFromParent - This method unlinks 'this' from the containing function
+ /// and deletes it.
+ ///
+ void eraseFromParent();
+
+
+
//===--------------------------------------------------------------------===//
/// Instruction iterator methods
///
Index: llvm/include/llvm/Function.h
diff -u llvm/include/llvm/Function.h:1.52 llvm/include/llvm/Function.h:1.53
--- llvm/include/llvm/Function.h:1.52 Wed Sep 1 17:55:34 2004
+++ llvm/include/llvm/Function.h Mon Oct 11 17:21:13 2004
@@ -114,6 +114,17 @@
setLinkage(ExternalLinkage);
}
+ /// removeFromParent - This method unlinks 'this' from the containing module,
+ /// but does not delete it.
+ ///
+ void removeFromParent();
+
+ /// eraseFromParent - This method unlinks 'this' from the containing module
+ /// and deletes it.
+ ///
+ void eraseFromParent();
+
+
// getNext/Prev - Return the next or previous function in the list. These
// methods should never be used directly, and are only used to implement the
// function list as part of the module.
Index: llvm/include/llvm/GlobalVariable.h
diff -u llvm/include/llvm/GlobalVariable.h:1.28 llvm/include/llvm/GlobalVariable.h:1.29
--- llvm/include/llvm/GlobalVariable.h:1.28 Sat Jul 17 18:29:46 2004
+++ llvm/include/llvm/GlobalVariable.h Mon Oct 11 17:21:13 2004
@@ -97,6 +97,16 @@
///
bool isConstant() const { return isConstantGlobal; }
void setConstant(bool Value) { isConstantGlobal = Value; }
+
+ /// removeFromParent - This method unlinks 'this' from the containing module,
+ /// but does not delete it.
+ ///
+ void removeFromParent();
+
+ /// eraseFromParent - This method unlinks 'this' from the containing module
+ /// and deletes it.
+ ///
+ void eraseFromParent();
/// Override Constant's implementation of this method so we can
/// replace constant initializers.
Index: llvm/include/llvm/Instruction.h
diff -u llvm/include/llvm/Instruction.h:1.60 llvm/include/llvm/Instruction.h:1.61
--- llvm/include/llvm/Instruction.h:1.60 Sun Jun 27 13:57:34 2004
+++ llvm/include/llvm/Instruction.h Mon Oct 11 17:21:13 2004
@@ -57,6 +57,10 @@
// Specialize setName to handle symbol table majik...
virtual void setName(const std::string &name, SymbolTable *ST = 0);
+ /// mayWriteToMemory - Return true if this instruction may modify memory.
+ ///
+ virtual bool mayWriteToMemory() const { return false; }
+
/// clone() - Create a copy of 'this' instruction that is identical in all
/// ways except the following:
/// * The instruction has no parent
@@ -76,9 +80,15 @@
Instruction *getPrev() { return Prev; }
const Instruction *getPrev() const { return Prev; }
- /// mayWriteToMemory - Return true if this instruction may modify memory.
+ /// removeFromParent - This method unlinks 'this' from the containing basic
+ /// block, but does not delete it.
///
- virtual bool mayWriteToMemory() const { return false; }
+ void removeFromParent();
+
+ /// eraseFromParent - This method unlinks 'this' from the containing basic
+ /// block and deletes it.
+ ///
+ void eraseFromParent();
// ---------------------------------------------------------------------------
/// Subclass classification... getOpcode() returns a member of
More information about the llvm-commits
mailing list