Changeset 58fe85a for src/InitTweak/InitTweak.h
- Timestamp:
- Jan 7, 2021, 3:27:00 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 2b4daf2, 64aeca0
- Parents:
- 3c64c668 (diff), eef8dfb (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.h
r3c64c668 r58fe85a 38 38 /// returns the first parameter of a constructor/destructor/assignment function 39 39 ObjectDecl * getParamThis( FunctionType * ftype ); 40 const ast::ObjectDecl * getParamThis(const ast::FunctionDecl * func); 40 41 41 42 /// generate a bitwise assignment operation. 42 43 ApplicationExpr * createBitwiseAssignment( Expression * dst, Expression * src ); 44 45 ast::Expr * createBitwiseAssignment( const ast::Expr * dst, const ast::Expr * src); 43 46 44 47 /// transform Initializer into an argument list that can be passed to a call expression … … 48 51 /// True if the resolver should try to construct dwt 49 52 bool tryConstruct( DeclarationWithType * dwt ); 53 bool tryConstruct( const ast::DeclWithType * dwt ); 50 54 51 55 /// True if the type can have a user-defined constructor 52 56 bool isConstructable( Type * t ); 57 bool isConstructable( const ast::Type * t ); 53 58 54 59 /// True if the Initializer contains designations 55 60 bool isDesignated( Initializer * init ); 61 bool isDesignated( const ast::Init * init ); 56 62 57 63 /// True if the ObjectDecl's Initializer nesting level is not deeper than the depth of its 58 64 /// type, where the depth of its type is the number of nested ArrayTypes + 1 59 65 bool checkInitDepth( ObjectDecl * objDecl ); 66 bool checkInitDepth( const ast::ObjectDecl * objDecl ); 60 67 61 68 /// returns the declaration of the function called by the expr (must be ApplicationExpr or UntypedExpr) … … 79 86 /// get all Ctor/Dtor call expressions from a Statement 80 87 void collectCtorDtorCalls( Statement * stmt, std::list< Expression * > & matches ); 81 std::vector< ast::ptr< ast::Expr >> collectCtorDtorCalls( const ast::Stmt * stmt );88 std::vector< const ast::Expr * > collectCtorDtorCalls( const ast::Stmt * stmt ); 82 89 83 90 /// get the Ctor/Dtor call expression from a Statement that looks like a generated ctor/dtor call … … 102 109 bool isConstExpr( Expression * expr ); 103 110 bool isConstExpr( Initializer * init ); 111 112 bool isConstExpr( const ast::Expr * expr ); 113 bool isConstExpr( const ast::Init * init ); 114 115 /// Modifies objDecl to have: 116 /// __attribute__((section (".data#"))) 117 /// which makes gcc put the declared variable in the data section, 118 /// which is helpful for global constants on newer gcc versions, 119 /// so that CFA's generated initialization won't segfault when writing it via a const cast. 120 /// The trailing # is an injected assembly comment, to suppress the "a" in 121 /// .section .data,"a" 122 /// .section .data#,"a" 123 /// to avoid assembler warning "ignoring changed section attributes for .data" 124 void addDataSectonAttribute( ObjectDecl * objDecl ); 125 126 void addDataSectionAttribute( ast::ObjectDecl * objDecl ); 104 127 105 128 class InitExpander_old {
Note:
See TracChangeset
for help on using the changeset viewer.