- Timestamp:
- May 22, 2019, 11:38:18 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ed5e798
- Parents:
- 907c545
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r907c545 r746ae82 755 755 get<Type>().accept1( node->base ), 756 756 get<Expression>().accept1( node->dimension ), 757 node->isVarLen,758 node->isStatic757 (bool)node->isVarLen, 758 (bool)node->isStatic 759 759 }; 760 760 return nullptr; … … 766 766 get<Type>().accept1( node->base ), 767 767 get<Expression>().accept1( node->dimension ), 768 node->isVarLen,769 node->isStatic768 (bool)node->isVarLen, 769 (bool)node->isStatic 770 770 }; 771 771 return nullptr; … … 790 790 791 791 const ast::Type * visit( const ast::FunctionType * node ) override final { 792 auto ty = new FunctionType { cv( node ), node->isVarArgs }; 792 auto ty = new FunctionType { 793 cv( node ), 794 (bool)node->isVarArgs 795 }; 793 796 ty->returnVals = get<DeclarationWithType>().acceptL( node->returns ); 794 797 ty->parameters = get<DeclarationWithType>().acceptL( node->params ); … … 907 910 908 911 const ast::Type * visit( const ast::TupleType * node ) override final { 909 (void)node; 912 this->node = new TupleType{ 913 cv( node ), 914 get<Type>().acceptL( node->types ) 915 // members generated by TupleType c'tor 916 }; 910 917 return nullptr; 911 918 } 912 919 913 920 const ast::Type * visit( const ast::TypeofType * node ) override final { 914 (void)node; 921 this->node = new TypeofType{ 922 cv( node ), 923 get<Expression>().accept1( node->expr ), 924 (bool)node->kind 925 }; 915 926 return nullptr; 916 927 } 917 928 918 929 const ast::Type * visit( const ast::VarArgsType * node ) override final { 919 (void)node;930 this->node = new VarArgsType{ cv( node ) }; 920 931 return nullptr; 921 932 } 922 933 923 934 const ast::Type * visit( const ast::ZeroType * node ) override final { 924 (void)node;935 this->node = new ZeroType{ cv( node ) }; 925 936 return nullptr; 926 937 } 927 938 928 939 const ast::Type * visit( const ast::OneType * node ) override final { 929 (void)node;930 return nullptr; 931 } 932 933 const ast::Type * visit( const ast::GlobalScopeType * node) override final {934 (void)node;940 this->node = new OneType{ cv( node ) }; 941 return nullptr; 942 } 943 944 const ast::Type * visit( const ast::GlobalScopeType * ) override final { 945 this->node = new GlobalScopeType{}; 935 946 return nullptr; 936 947 } … … 1831 1842 } 1832 1843 1833 virtual void visit( TupleType * ) override final { 1834 1835 } 1836 1837 virtual void visit( TypeofType * ) override final { 1838 1844 virtual void visit( TupleType * old ) override final { 1845 this->node = new ast::TupleType{ 1846 GET_ACCEPT_V( types, Type ), 1847 // members generated by TupleType c'tor 1848 cv( old ) 1849 }; 1850 } 1851 1852 virtual void visit( TypeofType * old ) override final { 1853 this->node = new ast::TypeofType{ 1854 GET_ACCEPT_1( expr, Expr ), 1855 (ast::TypeofType::Kind)old->is_basetypeof, 1856 cv( old ) 1857 }; 1839 1858 } 1840 1859 1841 1860 virtual void visit( AttrType * ) override final { 1842 1843 } 1844 1845 virtual void visit( VarArgsType * ) override final {1846 1847 } 1848 1849 virtual void visit( ZeroType * ) override final {1850 1851 } 1852 1853 virtual void visit( OneType * ) override final {1854 1861 assertf( false, "AttrType deprecated in new AST." ); 1862 } 1863 1864 virtual void visit( VarArgsType * old ) override final { 1865 this->node = new ast::VarArgsType{ cv( old ) }; 1866 } 1867 1868 virtual void visit( ZeroType * old ) override final { 1869 this->node = new ast::ZeroType{ cv( old ) }; 1870 } 1871 1872 virtual void visit( OneType * old ) override final { 1873 this->node = new ast::OneType{ cv( old ) }; 1855 1874 } 1856 1875 1857 1876 virtual void visit( GlobalScopeType * ) override final { 1858 1877 this->node = new ast::GlobalScopeType{}; 1859 1878 } 1860 1879 -
src/AST/Type.hpp
r907c545 r746ae82 514 514 class GlobalScopeType final : public Type { 515 515 public: 516 GlobalScopeType( CV::Qualifiers q = {} ) : Type( q) {}516 GlobalScopeType() : Type() {} 517 517 518 518 const Type * accept( Visitor & v ) const override { return v.visit( this ); }
Note: See TracChangeset
for help on using the changeset viewer.