llvm.org GIT mirror llvm / 7f4dd47
Changes to build with GCC 3.1 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3064 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 18 years ago
4 changed file(s) with 32 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
402402
403403 // Default implementation, requires user to populate it with values somehow.
404404 template // parse - Return true on error.
405 bool parse(Opt &O, const char *ArgName, const string &Arg) {
406 string ArgVal;
405 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
406 std::string ArgVal;
407407 if (hasArgStr)
408408 ArgVal = Arg;
409409 else
440440 //
441441 template<>
442442 class parser {
443 static bool parseImpl(Option &O, const string &Arg, bool &Val);
443 static bool parseImpl(Option &O, const std::string &Arg, bool &Val);
444444 public:
445445
446446 template // parse - Return true on error.
447 bool parse(Opt &O, const char *ArgName, const string &Arg) {
447 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
448448 bool Val;
449449 bool Error = parseImpl(O, Arg, Val);
450450 if (!Error) O.addValue(Val);
472472 //
473473 template<>
474474 class parser {
475 static bool parseImpl(Option &O, const string &Arg, int &Val);
475 static bool parseImpl(Option &O, const std::string &Arg, int &Val);
476476 public:
477477
478478 // parse - Return true on error.
479479 template
480 bool parse(Opt &O, const char *ArgName, const string &Arg) {
480 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
481481 int Val;
482482 bool Error = parseImpl(O, Arg, Val);
483483 if (!Error) O.addValue(Val);
505505 //
506506 template<>
507507 class parser {
508 static bool parseImpl(Option &O, const string &Arg, double &Val);
508 static bool parseImpl(Option &O, const std::string &Arg, double &Val);
509509 public:
510510
511511 // parse - Return true on error.
512512 template
513 bool parse(Opt &O, const char *ArgName, const string &Arg) {
513 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
514514 double Val;
515515 bool Error = parseImpl(O, Arg, Val);
516516 if (!Error) O.addValue(Val);
538538
539539
540540 //--------------------------------------------------
541 // parserring>
541 // parserd::string>
542542 //
543543 template<>
544 struct parserring> {
544 struct parserd::string> {
545545 // parse - Return true on error.
546546 template
547 bool parse(Opt &O, const char *ArgName, const string &Arg) {
547 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
548548 O.addValue(Arg);
549549 return false;
550550 }
88 #define LLVM_SUPPORT_DEPTH_FIRST_ITERATOR_H
99
1010 #include "Support/GraphTraits.h"
11 #include <iterator>
11 #include <Support/iterator>
1212 #include
1313 #include
1414
1515 // Generic Depth First Iterator
1616 template >
17 class df_iterator : public std::forward_iterator
18 ptrdiff_t> {
17 class df_iterator : public forward_iterator ptrdiff_t> {
18 typedef forward_iterator super;
19 typedef typename super::pointer pointer;
20
1921 typedef typename GT::NodeType NodeType;
2022 typedef typename GT::ChildIteratorType ChildItTy;
2123
88 #define LLVM_SUPPORT_DEPTH_FIRST_ITERATOR_H
99
1010 #include "Support/GraphTraits.h"
11 #include <iterator>
11 #include <Support/iterator>
1212 #include
1313 #include
1414
1515 // Generic Depth First Iterator
1616 template >
17 class df_iterator : public std::forward_iterator
18 ptrdiff_t> {
17 class df_iterator : public forward_iterator ptrdiff_t> {
18 typedef forward_iterator super;
19 typedef typename super::pointer pointer;
20
1921 typedef typename GT::NodeType NodeType;
2022 typedef typename GT::ChildIteratorType ChildItTy;
2123
402402
403403 // Default implementation, requires user to populate it with values somehow.
404404 template // parse - Return true on error.
405 bool parse(Opt &O, const char *ArgName, const string &Arg) {
406 string ArgVal;
405 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
406 std::string ArgVal;
407407 if (hasArgStr)
408408 ArgVal = Arg;
409409 else
440440 //
441441 template<>
442442 class parser {
443 static bool parseImpl(Option &O, const string &Arg, bool &Val);
443 static bool parseImpl(Option &O, const std::string &Arg, bool &Val);
444444 public:
445445
446446 template // parse - Return true on error.
447 bool parse(Opt &O, const char *ArgName, const string &Arg) {
447 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
448448 bool Val;
449449 bool Error = parseImpl(O, Arg, Val);
450450 if (!Error) O.addValue(Val);
472472 //
473473 template<>
474474 class parser {
475 static bool parseImpl(Option &O, const string &Arg, int &Val);
475 static bool parseImpl(Option &O, const std::string &Arg, int &Val);
476476 public:
477477
478478 // parse - Return true on error.
479479 template
480 bool parse(Opt &O, const char *ArgName, const string &Arg) {
480 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
481481 int Val;
482482 bool Error = parseImpl(O, Arg, Val);
483483 if (!Error) O.addValue(Val);
505505 //
506506 template<>
507507 class parser {
508 static bool parseImpl(Option &O, const string &Arg, double &Val);
508 static bool parseImpl(Option &O, const std::string &Arg, double &Val);
509509 public:
510510
511511 // parse - Return true on error.
512512 template
513 bool parse(Opt &O, const char *ArgName, const string &Arg) {
513 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
514514 double Val;
515515 bool Error = parseImpl(O, Arg, Val);
516516 if (!Error) O.addValue(Val);
538538
539539
540540 //--------------------------------------------------
541 // parserring>
541 // parserd::string>
542542 //
543543 template<>
544 struct parserring> {
544 struct parserd::string> {
545545 // parse - Return true on error.
546546 template
547 bool parse(Opt &O, const char *ArgName, const string &Arg) {
547 bool parse(Opt &O, const char *ArgName, const std::string &Arg) {
548548 O.addValue(Arg);
549549 return false;
550550 }