Changeset ffec1bf for src/AST


Ignore:
Timestamp:
Jul 25, 2022, 2:23:28 PM (22 months ago)
Author:
Fangren Yu <f37yu@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/AST
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r9e23b446 rffec1bf  
    168168                auto attr = get<Attribute>().acceptL( node->attributes );
    169169
     170                // This field can be unset very early on (Pre-FixReturnTypes).
     171                auto newType = (type) ? type->clone() : nullptr;
     172
    170173                auto decl = new ObjectDecl(
    171174                        node->name,
     
    173176                        LinkageSpec::Spec( node->linkage.val ),
    174177                        bfwd,
    175                         type->clone(),
     178                        newType,
    176179                        nullptr, // prevent infinite loop
    177180                        attr,
     
    15791582
    15801583        virtual void visit( const ObjectDecl * old ) override final {
     1584                if ( inCache( old ) ) {
     1585                        return;
     1586                }
    15811587                auto&& type = GET_ACCEPT_1(type, Type);
    15821588                auto&& init = GET_ACCEPT_1(init, Init);
    15831589                auto&& bfwd = GET_ACCEPT_1(bitfieldWidth, Expr);
    15841590                auto&& attr = GET_ACCEPT_V(attributes, Attribute);
    1585                 if ( inCache( old ) ) {
    1586                         return;
    1587                 }
     1591
    15881592                auto decl = new ast::ObjectDecl(
    15891593                        old->location,
  • src/AST/Decl.hpp

    r9e23b446 rffec1bf  
    315315
    316316        EnumDecl( const CodeLocation& loc, const std::string& name,
    317                 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type * base = nullptr,
    318                  std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() )
     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 >() )
    319319        : AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {}
    320320
  • src/AST/Expr.cpp

    r9e23b446 rffec1bf  
    272272        // Adjust the length of the string for the terminator.
    273273        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 );
    275275        const std::string strValue = "\"" + str + "\"";
    276276        return new ConstantExpr( loc, strType, strValue, std::nullopt );
  • src/AST/Pass.impl.hpp

    r9e23b446 rffec1bf  
    681681        if ( __visit_children() ) {
    682682                // unlike structs, traits, and unions, enums inject their members into the global scope
     683                maybe_accept( node, &EnumDecl::base );
    683684                maybe_accept( node, &EnumDecl::params     );
    684685                maybe_accept( node, &EnumDecl::members    );
  • src/AST/module.mk

    r9e23b446 rffec1bf  
    3737        AST/Init.cpp \
    3838        AST/Init.hpp \
     39        AST/Inspect.cpp \
     40        AST/Inspect.hpp \
    3941        AST/Label.hpp \
    4042        AST/LinkageSpec.cpp \
Note: See TracChangeset for help on using the changeset viewer.