Changeset 7d651a6
- Timestamp:
- Nov 5, 2020, 7:25:03 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 3febb2d
- Parents:
- a3f5208a
- Location:
- src/InitTweak
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixGlobalInit.cc
ra3f5208a r7d651a6 183 183 } // if 184 184 if ( const ast::Stmt * ctor = ctorInit->ctor ) { 185 addDataSectionAttribute(mutDecl); 185 186 initStmts.push_back( ctor ); 186 187 mutDecl->init = nullptr; -
src/InitTweak/FixInitNew.cpp
ra3f5208a r7d651a6 864 864 if ( const ast::Stmt * ctor = ctorInit->ctor ) { 865 865 if ( objDecl->storage.is_static ) { 866 addDataSectionAttribute(objDecl); 866 867 // originally wanted to take advantage of gcc nested functions, but 867 868 // we get memory errors with this approach. To remedy this, the static … … 947 948 objDecl->name = objDecl->name + staticNamer.newName(); 948 949 objDecl->mangleName = Mangle::mangle( objDecl ); 950 objDecl->init = nullptr; 949 951 950 952 // xxx - temporary hack: need to return a declaration, but want to hoist the current object out of this scope -
src/InitTweak/InitTweak.cc
ra3f5208a r7d651a6 1113 1113 } 1114 1114 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 1115 1120 } -
src/InitTweak/InitTweak.h
ra3f5208a r7d651a6 119 119 void addDataSectonAttribute( ObjectDecl * objDecl ); 120 120 121 void addDataSectionAttribute( ast::ObjectDecl * objDecl ); 122 121 123 class InitExpander_old { 122 124 public:
Note: See TracChangeset
for help on using the changeset viewer.