//===- llvm/Support/PassNameParser.h ----------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
//
// This file the PassNameParser and FilteredPassNameParser<> classes, which are
// used to add command line arguments to a utility for all of the passes that
#ifndef LLVM_SUPPORT_PASS_NAME_PARSER_H
#define LLVM_SUPPORT_PASS_NAME_PARSER_H
-#include "Support/CommandLine.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Pass.h"
#include <algorithm>
+#include <iostream>
+
+namespace llvm {
//===----------------------------------------------------------------------===//
// PassNameParser class - Make use of the pass registration mechanism to
// Ignore non-selectable and non-constructible passes! Ignore
// non-optimizations.
return P->getPassArgument() == 0 || *P->getPassArgument() == 0 ||
- (P->getNormalCtor() == 0 && P->getDataCtor() == 0 &&
- P->getTargetCtor() == 0) ||
+ (P->getNormalCtor() == 0 && P->getTargetCtor() == 0) ||
ignorablePassImpl(P);
}
//
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());
}
}
};
+} // End llvm namespace
+
#endif