Changeset 7b71402


Ignore:
Timestamp:
Jun 27, 2022, 3:55:29 PM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
43aec9e
Parents:
b01d459
Message:

Some white-space and comment fixes.

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    rb01d459 r7b71402  
    316316        EnumDecl( const CodeLocation& loc, const std::string& name,
    317317                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 >() )
     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/Inspect.cpp

    rb01d459 r7b71402  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Node.hpp --
     7// Inspect.cpp -- Helpers to get information from the AST.
    88//
    99// Author           : Thierry Delisle
    1010// Created On       : Fri Jun 24 13:16:31 2022
    11 // Last Modified By :
    12 // Last Modified On :
    13 // Update Count     :
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jun 27 15:35:00 2022
     13// Update Count     : 1
    1414//
    1515
     
    2121
    2222namespace ast {
    23         bool structHasFlexibleArray( const ast::StructDecl * decl ) {
    24                 if(decl->members.size() == 0) return false;
    25                 const auto & last = *decl->members.rbegin();
    26                 auto lastd = last.as<ast::DeclWithType>();
    27                 if(!lastd) return false; // I don't know what this is possible, but it might be.
    28                 auto atype = dynamic_cast<const ast::ArrayType *>(lastd->get_type());
    29                 if(!atype) return false;
    30                 return !atype->isVarLen && !atype->dimension;
    31         }
    32 };
     23
     24bool structHasFlexibleArray( const ast::StructDecl * decl ) {
     25        if(decl->members.size() == 0) return false;
     26        const auto & last = *decl->members.rbegin();
     27        auto lastd = last.as<ast::DeclWithType>();
     28        // I don't know what this is possible, but it might be.
     29        if(!lastd) return false;
     30        auto atype = dynamic_cast<const ast::ArrayType *>(lastd->get_type());
     31        if(!atype) return false;
     32        return !atype->isVarLen && !atype->dimension;
     33}
     34
     35} // namespace ast
  • src/AST/Inspect.hpp

    rb01d459 r7b71402  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Node.hpp --
     7// Inspect.hpp -- Helpers to get information from the AST.
    88//
    99// Author           : Thierry Delisle
    1010// Created On       : Fri Jun 24 13:16:31 2022
    11 // Last Modified By :
    12 // Last Modified On :
    13 // Update Count     :
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jun 27 15:35:00 2022
     13// Update Count     : 1
    1414//
    1515
     
    1717
    1818namespace ast {
    19         bool structHasFlexibleArray( const ast::StructDecl * );
     19
     20// Does the structure end in a flexable array declaration?
     21bool structHasFlexibleArray( const ast::StructDecl * );
     22
    2023}
Note: See TracChangeset for help on using the changeset viewer.