llvm.org GIT mirror llvm / b5f456a
[llvm] Revert r231274: "Devirtualize ~parser<T> by making it protected in base classes and making derived classes final" Summary: This patch was previously applied in r231221, and reverted in r231254 because it broke self-hosting. It was subsequently fixed and reapplied in r231274. Unfortunately, making the `parser<T>` classes final prevents inheritance which makes it impossible to implement custom parsers. Reverting r231221 restores the ability to customize parsers. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: craig.topper, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60955 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359902 91177308-0d34-0410-b5e6-96231b3b80d8 Don Hinton 1 year, 5 months ago
1 changed file(s) with 11 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
826826 public:
827827 basic_parser_impl(Option &) {}
828828
829 virtual ~basic_parser_impl() {}
830
829831 enum ValueExpected getValueExpectedFlagDefault() const {
830832 return ValueRequired;
831833 }
853855 virtual void anchor();
854856
855857 protected:
856 ~basic_parser_impl() = default;
857
858858 // A helper for basic_parser::printOptionDiff.
859859 void printOptionName(const Option &O, size_t GlobalWidth) const;
860860 };
868868 using OptVal = OptionValue;
869869
870870 basic_parser(Option &O) : basic_parser_impl(O) {}
871
872 protected:
873 ~basic_parser() = default;
874871 };
875872
876873 //--------------------------------------------------
877874 // parser
878875 //
879 template <> class parser final : public basic_parser {
876 template <> class parser : public basic_parser {
880877 public:
881878 parser(Option &O) : basic_parser(O) {}
882879
903900
904901 //--------------------------------------------------
905902 // parser
906 template <>
907 class parser final : public basic_parser {
903 template <> class parser : public basic_parser {
908904 public:
909905 parser(Option &O) : basic_parser(O) {}
910906
930926 //--------------------------------------------------
931927 // parser
932928 //
933 template <> class parser final : public basic_parser {
929 template <> class parser : public basic_parser {
934930 public:
935931 parser(Option &O) : basic_parser(O) {}
936932
952948 //--------------------------------------------------
953949 // parser
954950 //
955 template <> class parser final : public basic_parser {
951 template <> class parser : public basic_parser {
956952 public:
957953 parser(Option &O) : basic_parser(O) {}
958954
998994 // parser
999995 //
1000996 template <>
1001 class parser final
1002 : public basic_parser {
997 class parser : public basic_parser {
1003998 public:
1004999 parser(Option &O) : basic_parser(O) {}
10051000
10221017 //--------------------------------------------------
10231018 // parser
10241019 //
1025 template <> class parser final : public basic_parser {
1020 template <> class parser : public basic_parser {
10261021 public:
10271022 parser(Option &O) : basic_parser(O) {}
10281023
10441039 //--------------------------------------------------
10451040 // parser
10461041 //
1047 template <> class parser final : public basic_parser {
1042 template <> class parser : public basic_parser {
10481043 public:
10491044 parser(Option &O) : basic_parser(O) {}
10501045
10661061 //--------------------------------------------------
10671062 // parser
10681063 //
1069 template <> class parser final : public basic_parser {
1064 template <> class parser : public basic_parser {
10701065 public:
10711066 parser(Option &O) : basic_parser(O) {}
10721067
10911086 //--------------------------------------------------
10921087 // parser
10931088 //
1094 template <> class parser final : public basic_parser {
1089 template <> class parser : public basic_parser {
10951090 public:
10961091 parser(Option &O) : basic_parser(O) {}
10971092