- Timestamp:
- Jul 25, 2022, 2:23:28 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 4c48be0, 5cf1228, def751f
- Parents:
- 9e23b446 (diff), 1f950c3b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/AST
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/AST/Convert.cpp ¶
r9e23b446 rffec1bf 168 168 auto attr = get<Attribute>().acceptL( node->attributes ); 169 169 170 // This field can be unset very early on (Pre-FixReturnTypes). 171 auto newType = (type) ? type->clone() : nullptr; 172 170 173 auto decl = new ObjectDecl( 171 174 node->name, … … 173 176 LinkageSpec::Spec( node->linkage.val ), 174 177 bfwd, 175 type->clone(),178 newType, 176 179 nullptr, // prevent infinite loop 177 180 attr, … … 1579 1582 1580 1583 virtual void visit( const ObjectDecl * old ) override final { 1584 if ( inCache( old ) ) { 1585 return; 1586 } 1581 1587 auto&& type = GET_ACCEPT_1(type, Type); 1582 1588 auto&& init = GET_ACCEPT_1(init, Init); 1583 1589 auto&& bfwd = GET_ACCEPT_1(bitfieldWidth, Expr); 1584 1590 auto&& attr = GET_ACCEPT_V(attributes, Attribute); 1585 if ( inCache( old ) ) { 1586 return; 1587 } 1591 1588 1592 auto decl = new ast::ObjectDecl( 1589 1593 old->location, -
TabularUnified src/AST/Decl.hpp ¶
r9e23b446 rffec1bf 315 315 316 316 EnumDecl( const CodeLocation& loc, const std::string& name, 317 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type * base = nullptr,318 317 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type const * base = nullptr, 318 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() ) 319 319 : AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {} 320 320 -
TabularUnified src/AST/Expr.cpp ¶
r9e23b446 rffec1bf 272 272 // Adjust the length of the string for the terminator. 273 273 const Expr * strSize = from_ulong( loc, str.size() + 1 ); 274 const Type * strType = new ArrayType( charType, strSize, FixedLen, StaticDim );274 const Type * strType = new ArrayType( charType, strSize, FixedLen, DynamicDim ); 275 275 const std::string strValue = "\"" + str + "\""; 276 276 return new ConstantExpr( loc, strType, strValue, std::nullopt ); -
TabularUnified src/AST/Pass.impl.hpp ¶
r9e23b446 rffec1bf 681 681 if ( __visit_children() ) { 682 682 // unlike structs, traits, and unions, enums inject their members into the global scope 683 maybe_accept( node, &EnumDecl::base ); 683 684 maybe_accept( node, &EnumDecl::params ); 684 685 maybe_accept( node, &EnumDecl::members ); -
TabularUnified src/AST/module.mk ¶
r9e23b446 rffec1bf 37 37 AST/Init.cpp \ 38 38 AST/Init.hpp \ 39 AST/Inspect.cpp \ 40 AST/Inspect.hpp \ 39 41 AST/Label.hpp \ 40 42 AST/LinkageSpec.cpp \
Note: See TracChangeset
for help on using the changeset viewer.