Add support for stpncpy_chk.
[oota-llvm.git] / include / llvm / Support / PassNameParser.h
index 312a8a6f11b9e365832cf81ba337d4c8a6cf7f86..cdca978cfef64cc642f0ca201824acfa5dc2d57a 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     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 is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -24,6 +24,8 @@
 #define LLVM_SUPPORT_PASS_NAME_PARSER_H
 
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/raw_ostream.h"
 #include "llvm/Pass.h"
 #include <algorithm>
 #include <cstring>
@@ -39,7 +41,9 @@ class PassNameParser : public PassRegistrationListener,
   cl::Option *Opt;
 public:
   PassNameParser() : Opt(0) {}
-
+  virtual ~PassNameParser();
+                         
+                         
   void initialize(cl::Option &O) {
     Opt = &O;
     cl::parser<const PassInfo*>::initialize(O);
@@ -65,9 +69,9 @@ public:
   virtual void passRegistered(const PassInfo *P) {
     if (ignorablePass(P) || !Opt) return;
     if (findOption(P->getPassArgument()) != getNumOptions()) {
-      cerr << "Two passes with the same argument (-"
+      errs() << "Two passes with the same argument (-"
            << P->getPassArgument() << ") attempted to be registered!\n";
-      abort();
+      llvm_unreachable(0);
     }
     addLiteralOption(P->getPassArgument(), P, P->getPassName());
   }
@@ -82,7 +86,7 @@ public:
 
   // printOptionInfo - Print out information about this option.  Override the
   // default implementation to sort the table before we print...
-  virtual void printOptionInfo(const cl::Option &O, unsigned GlobalWidth) const{
+  virtual void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const {
     PassNameParser *PNP = const_cast<PassNameParser*>(this);
     std::sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan);
     cl::parser<const PassInfo*>::printOptionInfo(O, GlobalWidth);
@@ -129,4 +133,5 @@ public:
 };
 
 } // End llvm namespace
+
 #endif