Changeset 14cebb7a


Ignore:
Timestamp:
May 10, 2019, 9:31:29 AM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
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:
36354b1
Parents:
77a3f41
Message:

Removed trailing white-space in AST.

Location:
src/AST
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Bitfield.hpp

    r77a3f41 r14cebb7a  
    1919
    2020/// Make a type a bitfield.
    21 /// Include in type definition to add operators. Used to simulate inheritance because union 
     21/// Include in type definition to add operators. Used to simulate inheritance because union
    2222/// does not allow it. Requires type to have `unsigned val` field
    2323/// @param BFType  Name of containing type
  • src/AST/Decl.hpp

    r77a3f41 r14cebb7a  
    4646        bool extension = false;
    4747
    48         Decl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 
     48        Decl( const CodeLocation& loc, const std::string& name, Storage::Classes storage,
    4949                Linkage::Spec linkage )
    5050        : ParseNode( loc ), name( name ), storage( storage ), linkage( linkage ) {}
     
    6868        /// This field is generated by SymTab::Validate::Pass2
    6969        std::string mangleName;
    70         /// Stores the scope level at which the variable was declared. 
     70        /// Stores the scope level at which the variable was declared.
    7171        /// Used to access shadowed identifiers.
    7272        int scopeLevel = 0;
     
    7777        bool isDeleted = false;
    7878
    79         DeclWithType( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 
     79        DeclWithType( const CodeLocation& loc, const std::string& name, Storage::Classes storage,
    8080                Linkage::Spec linkage, std::vector<ptr<Attribute>>&& attrs, Function::Specs fs )
    81         : Decl( loc, name, storage, linkage ), mangleName(), attributes( std::move(attrs) ), 
     81        : Decl( loc, name, storage, linkage ), mangleName(), attributes( std::move(attrs) ),
    8282                funcSpec(fs), asmName() {}
    83        
     83
    8484        std::string scopedMangleName() const { return mangleName + "_" + std::to_string(scopeLevel); }
    8585
     
    102102
    103103        ObjectDecl( const CodeLocation& loc, const std::string& name, Type* type, Init* init = nullptr,
    104                 Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::C, Expr* bitWd = nullptr, 
     104                Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::C, Expr* bitWd = nullptr,
    105105                std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {})
    106         : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ), 
     106        : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ),
    107107          init( init ), bitfieldWidth( bitWd ) {}
    108        
     108
    109109        const Type* get_type() const override { return type; }
    110110        void set_type( Type* ty ) override { type = ty; }
     
    124124        readonly<AggregateDecl> parent = {};
    125125
    126         AggregateDecl( const CodeLocation& loc, const std::string& name, 
    127                 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
    128         : Decl( loc, name, Storage::Classes{}, linkage ), members(), parameters(), 
     126        AggregateDecl( const CodeLocation& loc, const std::string& name,
     127                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
     128        : Decl( loc, name, Storage::Classes{}, linkage ), members(), parameters(),
    129129          attributes( std::move(attrs) ) {}
    130        
     130
    131131        AggregateDecl* set_body( bool b ) { body = b; return this; }
    132132
     
    141141        DeclarationNode::Aggregate kind;
    142142
    143         StructDecl( const CodeLocation& loc, const std::string& name, 
    144                 DeclarationNode::Aggregate kind = DeclarationNode::Struct, 
     143        StructDecl( const CodeLocation& loc, const std::string& name,
     144                DeclarationNode::Aggregate kind = DeclarationNode::Struct,
    145145                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
    146146        : AggregateDecl( loc, name, std::move(attrs), linkage ), kind( kind ) {}
     
    160160class UnionDecl final : public AggregateDecl {
    161161public:
    162         UnionDecl( const CodeLocation& loc, const std::string& name, 
     162        UnionDecl( const CodeLocation& loc, const std::string& name,
    163163                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
    164164        : AggregateDecl( loc, name, std::move(attrs), linkage ) {}
     
    174174class EnumDecl final : public AggregateDecl {
    175175public:
    176         EnumDecl( const CodeLocation& loc, const std::string& name, 
     176        EnumDecl( const CodeLocation& loc, const std::string& name,
    177177                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
    178178        : AggregateDecl( loc, name, std::move(attrs), linkage ), enumValues() {}
     
    194194class TraitDecl final : public AggregateDecl {
    195195public:
    196         TraitDecl( const CodeLocation& loc, const std::string& name, 
     196        TraitDecl( const CodeLocation& loc, const std::string& name,
    197197                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
    198198        : AggregateDecl( loc, name, std::move(attrs), linkage ) {}
  • src/AST/Label.hpp

    r77a3f41 r14cebb7a  
    3434                std::vector< ptr<Attribute> > attributes;
    3535
    36                 Label( CodeLocation loc, const std::string& name = "", 
     36                Label( CodeLocation loc, const std::string& name = "",
    3737                        const std::vector<ptr<Attribute>>& attrs = std::vector<ptr<Attribute>>{} )
    3838                : location( loc ), name( name ), attributes( attrs ) {}
     
    4747
    4848        inline std::ostream& operator<< ( std::ostream& out, const Label& l ) { return out << l.name; }
    49        
     49
    5050}
    5151
  • src/AST/LinkageSpec.cpp

    r77a3f41 r14cebb7a  
    5454                }
    5555        }
    56        
     56
    5757}
    5858
  • src/AST/LinkageSpec.hpp

    r77a3f41 r14cebb7a  
    4949
    5050        /// If `cmd` = "C" returns `spec` with `is_mangled = false`.
    51         /// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`. 
     51        /// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`.
    5252        Spec update( CodeLocation loc, Spec spec, const std::string * cmd );
    5353
     
    5656
    5757        // Pre-defined flag combinations
    58        
     58
    5959        /// C built-in defined in prelude
    6060        constexpr Spec Intrinsic  = { Mangle | Generate | Overrideable | Builtin };
  • src/AST/Node.hpp

    r77a3f41 r14cebb7a  
    2727class Node {
    2828public:
    29         // override defaults to ensure assignment doesn't 
     29        // override defaults to ensure assignment doesn't
    3030        // change/share reference counts
    3131        Node() = default;
  • src/AST/ParseNode.hpp

    r77a3f41 r14cebb7a  
    2828
    2929                // Default constructor is deliberately omitted, all ParseNodes must have a location.
    30                 // Escape hatch if needed is to explicitly pass a default-constructed location, but 
     30                // Escape hatch if needed is to explicitly pass a default-constructed location, but
    3131                // this should be used sparingly.
    3232
  • src/AST/porting.md

    r77a3f41 r14cebb7a  
    5959  * for concision and consistency with subclasses:
    6060    * `Declaration` => `ast::Decl`
    61         * `DeclarationWithType` => `ast::DeclWithType` 
     61        * `DeclarationWithType` => `ast::DeclWithType`
    6262        * `Expression` => `ast::Expr`
    6363        * `Initializer` => `ast::Init`
Note: See TracChangeset for help on using the changeset viewer.