[llvm-commits] CVS: llvm/include/llvm/Support/PassNameParser.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Dec 6 22:42:01 PST 2002
Changes in directory llvm/include/llvm/Support:
PassNameParser.h updated: 1.3 -> 1.4
---
Log message:
Give better error message if two passes of the same argument are registered
---
Diffs of the changes:
Index: llvm/include/llvm/Support/PassNameParser.h
diff -u llvm/include/llvm/Support/PassNameParser.h:1.3 llvm/include/llvm/Support/PassNameParser.h:1.4
--- llvm/include/llvm/Support/PassNameParser.h:1.3 Tue Nov 19 11:10:14 2002
+++ llvm/include/llvm/Support/PassNameParser.h Fri Dec 6 22:41:22 2002
@@ -19,6 +19,7 @@
#include "Support/CommandLine.h"
#include "llvm/Pass.h"
#include <algorithm>
+#include <iostream>
//===----------------------------------------------------------------------===//
// PassNameParser class - Make use of the pass registration mechanism to
@@ -56,8 +57,11 @@
//
virtual void passRegistered(const PassInfo *P) {
if (ignorablePass(P) || !Opt) return;
- assert(findOption(P->getPassArgument()) == getNumOptions() &&
- "Two passes with the same argument attempted to be registered!");
+ if (findOption(P->getPassArgument()) != getNumOptions()) {
+ std::cerr << "Two passes with the same argument (-"
+ << P->getPassArgument() << ") attempted to be registered!\n";
+ abort();
+ }
addLiteralOption(P->getPassArgument(), P, P->getPassName());
Opt->addArgument(P->getPassArgument());
}
More information about the llvm-commits
mailing list