Changeset 3959595 for src


Ignore:
Timestamp:
Nov 5, 2020, 9:52:11 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
231b18f, b5d51b0
Parents:
be73f30 (diff), 3febb2d (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/InitTweak
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixGlobalInit.cc

    rbe73f30 r3959595  
    183183                        } // if
    184184                        if ( const ast::Stmt * ctor = ctorInit->ctor ) {
     185                                addDataSectionAttribute(mutDecl);
    185186                                initStmts.push_back( ctor );
    186187                                mutDecl->init = nullptr;
  • src/InitTweak/FixInitNew.cpp

    rbe73f30 r3959595  
    864864                        if ( const ast::Stmt * ctor = ctorInit->ctor ) {
    865865                                if ( objDecl->storage.is_static ) {
     866                                        addDataSectionAttribute(objDecl);
    866867                                        // originally wanted to take advantage of gcc nested functions, but
    867868                                        // we get memory errors with this approach. To remedy this, the static
     
    947948                                                objDecl->name = objDecl->name + staticNamer.newName();
    948949                                                objDecl->mangleName = Mangle::mangle( objDecl );
     950                                                objDecl->init = nullptr;
    949951
    950952                                                // xxx - temporary hack: need to return a declaration, but want to hoist the current object out of this scope
  • src/InitTweak/InitTweak.cc

    rbe73f30 r3959595  
    11131113        }
    11141114
     1115        void addDataSectionAttribute( ast::ObjectDecl * objDecl ) {
     1116                auto strLitT = new ast::PointerType(new ast::BasicType(ast::BasicType::Char));
     1117                objDecl->attributes.push_back(new ast::Attribute("section", {new ast::ConstantExpr(objDecl->location, strLitT, "\".data#\"", std::nullopt)}));
     1118        }
     1119
    11151120}
  • src/InitTweak/InitTweak.h

    rbe73f30 r3959595  
    119119        void addDataSectonAttribute( ObjectDecl * objDecl );
    120120
     121        void addDataSectionAttribute( ast::ObjectDecl * objDecl );
     122
    121123        class InitExpander_old {
    122124        public:
Note: See TracChangeset for help on using the changeset viewer.