Changeset 0b0f1dd


Ignore:
Timestamp:
Feb 16, 2018, 2:36:29 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
76b378d
Parents:
359f29f
Message:

Propagated code location to TypeData?

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    r359f29f r0b0f1dd  
    3131using namespace std;
    3232
    33 TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ {
     33TypeData::TypeData( Kind k ) : location( yylloc ), kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ {
    3434        switch ( kind ) {
    3535          case Unknown:
     
    800800        assert( td->base );
    801801        if ( td->symbolic.isTypedef ) {
    802                 ret = new TypedefDecl( name, scs, typebuild( td->base ), linkage );
     802                ret = new TypedefDecl( name, td->location, scs, typebuild( td->base ), linkage );
    803803        } else {
    804804                ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true );
  • src/Parser/TypeData.h

    r359f29f r0b0f1dd  
    7676        };
    7777
     78        CodeLocation location;
     79
    7880        Kind kind;
    7981        TypeData * base;
  • src/SymTab/Validate.cc

    r359f29f r0b0f1dd  
    857857                                type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() );
    858858                        } // if
    859                         TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), Type::StorageClasses(), type, aggDecl->get_linkage() ) );
     859                        TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), aggDecl->location, Type::StorageClasses(), type, aggDecl->get_linkage() ) );
    860860                        typedefNames[ aggDecl->get_name() ] = std::make_pair( std::move( tyDecl ), scopeLevel );
    861861                } // if
  • src/SynTree/Declaration.h

    r359f29f r0b0f1dd  
    245245        typedef NamedTypeDecl Parent;
    246246  public:
    247         TypedefDecl( const std::string &name, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) : Parent( name, scs, type ) { set_linkage( spec ); }
     247        TypedefDecl( const std::string &name, CodeLocation location, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall )
     248                : Parent( name, scs, type ) { set_linkage( spec ); this->location = location; }
     249
    248250        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    249251
Note: See TracChangeset for help on using the changeset viewer.