Changeset e874605 for src/Parser
- Timestamp:
- Oct 28, 2022, 3:11:57 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 93d2219
- Parents:
- 77de429
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Parser/DeclarationNode.cc ¶
r77de429 re874605 27 27 #include "SynTree/LinkageSpec.h" // for Spec, linkageName, Cforall 28 28 #include "SynTree/Attribute.h" // for Attribute 29 #include "SynTree/Declaration.h" // for TypeDecl, ObjectDecl, Declaration29 #include "SynTree/Declaration.h" // for TypeDecl, ObjectDecl, InlineValueDecl, Declaration 30 30 #include "SynTree/Expression.h" // for Expression, ConstantExpr 31 31 #include "SynTree/Statement.h" // for AsmStmt … … 1165 1165 SemanticError( this, "invalid function specifier for " ); 1166 1166 } // if 1167 if ( enumInLine ) { 1168 return new InlineValueDecl( *name, storageClasses, linkage, nullptr ); 1169 } // if 1167 1170 assertf( name, "ObjectDecl must a have name\n" ); 1168 1171 return (new ObjectDecl( *name, storageClasses, linkage, maybeBuild< Expression >( bitfieldWidth ), nullptr, maybeBuild< Initializer >( initializer ) ))->set_asmName( asmName )->set_extension( extension ); -
TabularUnified src/Parser/ExpressionNode.cc ¶
r77de429 re874605 519 519 } 520 520 } 521 auto ret = new QualifiedNameExpr( newDecl, name->name ); 522 if ( auto e = dynamic_cast<EnumDecl*>(newDecl) ) { 523 auto enumInst = new EnumInstType( Type::Qualifiers(), e ); 524 auto obj = new ObjectDecl( name->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, enumInst, nullptr ); 525 } 526 return ret; 521 return new QualifiedNameExpr( newDecl, name->name ); 527 522 } 528 523 -
TabularUnified src/Parser/TypeData.cc ¶
r77de429 re874605 925 925 for ( const DeclarationNode * cur = td->enumeration.constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) { 926 926 if ( cur->enumInLine ) { 927 // Tell the compiler this is a inline value placeholder 928 ObjectDecl * member = dynamic_cast< ObjectDecl* >(* members); 929 member->enumInLine = true; 930 } 931 if ( ret->isTyped && !ret->base && cur->has_enumeratorValue() ) { 927 // Do Nothing 928 } else if ( ret->isTyped && !ret->base && cur->has_enumeratorValue() ) { 932 929 SemanticError( td->location, "Enumerator of enum(void) cannot have an explicit initializer value." ); 933 930 } else if ( cur->has_enumeratorValue() ) {
Note: See TracChangeset
for help on using the changeset viewer.