aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/InstVisitor.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Support/InstVisitor.h b/include/llvm/Support/InstVisitor.h
index a1c0085443..8b3a28d5f9 100644
--- a/include/llvm/Support/InstVisitor.h
+++ b/include/llvm/Support/InstVisitor.h
@@ -88,6 +88,10 @@ struct InstVisitor {
// Define visitors for functions and basic blocks...
//
+ void visit(Module &M) {
+ ((SubClass*)this)->visitModule(M);
+ visit(M.begin(), M.end());
+ }
void visit(Function &F) {
((SubClass*)this)->visitFunction(F);
visit(F.begin(), F.end());
@@ -127,6 +131,7 @@ struct InstVisitor {
// When visiting a module, function or basic block directly, these methods get
// called to indicate when transitioning into a new unit.
//
+ void visitModule (Module &M) {}
void visitFunction (Function &F) {}
void visitBasicBlock(BasicBlock &BB) {}