[llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Nov 21 10:53:18 PST 2003
Changes in directory llvm/lib/VMCore:
BasicBlock.cpp updated: 1.37 -> 1.38
---
Log message:
Minor cleanups and simplifications
---
Diffs of the changes: (+25 -27)
Index: llvm/lib/VMCore/BasicBlock.cpp
diff -u llvm/lib/VMCore/BasicBlock.cpp:1.37 llvm/lib/VMCore/BasicBlock.cpp:1.38
--- llvm/lib/VMCore/BasicBlock.cpp:1.37 Thu Nov 20 12:25:24 2003
+++ llvm/lib/VMCore/BasicBlock.cpp Fri Nov 21 10:52:05 2003
@@ -21,33 +21,33 @@
#include "Support/LeakDetector.h"
#include "SymbolTableListTraitsImpl.h"
#include <algorithm>
+using namespace llvm;
-namespace llvm {
-
-// DummyInst - An instance of this class is used to mark the end of the
-// instruction list. This is not a real instruction.
-//
-struct DummyInst : public Instruction {
- DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd) {
- // This should not be garbage monitored.
- LeakDetector::removeGarbageObject(this);
- }
+namespace {
+ /// DummyInst - An instance of this class is used to mark the end of the
+ /// instruction list. This is not a real instruction.
+ struct DummyInst : public Instruction {
+ DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd) {
+ // This should not be garbage monitored.
+ LeakDetector::removeGarbageObject(this);
+ }
- virtual Instruction *clone() const {
- assert(0 && "Cannot clone EOL");abort();
- return 0;
- }
- virtual const char *getOpcodeName() const { return "*end-of-list-inst*"; }
+ virtual Instruction *clone() const {
+ assert(0 && "Cannot clone EOL");abort();
+ return 0;
+ }
+ virtual const char *getOpcodeName() const { return "*end-of-list-inst*"; }
- // Methods for support type inquiry through isa, cast, and dyn_cast...
- static inline bool classof(const DummyInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == OtherOpsEnd;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
+ // Methods for support type inquiry through isa, cast, and dyn_cast...
+ static inline bool classof(const DummyInst *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return I->getOpcode() == OtherOpsEnd;
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ }
+ };
+}
Instruction *ilist_traits<Instruction>::createNode() {
return new DummyInst();
@@ -243,7 +243,7 @@
} while (Inst != &*I); // Loop until we move the specified instruction.
// Add a branch instruction to the newly formed basic block.
- new BranchInst(New, 0, 0, this);
+ new BranchInst(New, this);
// Now we must loop through all of the successors of the New block (which
// _were_ the successors of the 'this' block), and update any PHI nodes in
@@ -265,5 +265,3 @@
}
return New;
}
-
-} // End llvm namespace
More information about the llvm-commits
mailing list