Changeset 1ba88a0 for src/InitTweak/InitTweak.cc
- Timestamp:
- Sep 4, 2016, 3:25:32 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- b16898e
- Parents:
- 85517ddb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
r85517ddb r1ba88a0 232 232 return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) && 233 233 (objDecl->get_init() == NULL || 234 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) && 235 ! isDesignated( objDecl->get_init() ) 234 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) 236 235 && objDecl->get_storageClass() != DeclarationNode::Extern; 237 236 } … … 391 390 virtual void visit( ApplicationExpr *applicationExpr ) { isConstExpr = false; } 392 391 virtual void visit( UntypedExpr *untypedExpr ) { isConstExpr = false; } 393 virtual void visit( NameExpr *nameExpr ) { isConstExpr = false; } 394 virtual void visit( CastExpr *castExpr ) { isConstExpr = false; } 392 virtual void visit( NameExpr *nameExpr ) { 393 // xxx - temporary hack, because 0 and 1 really should be constexprs, even though they technically aren't in Cforall today 394 if ( nameExpr->get_name() != "0" && nameExpr->get_name() != "1" ) isConstExpr = false; 395 } 396 // virtual void visit( CastExpr *castExpr ) { isConstExpr = false; } 397 virtual void visit( AddressExpr *addressExpr ) { 398 // address of a variable or member expression is constexpr 399 Expression * arg = addressExpr->get_arg(); 400 if ( ! dynamic_cast< NameExpr * >( arg) && ! dynamic_cast< VariableExpr * >( arg ) && ! dynamic_cast< MemberExpr * >( arg ) && ! dynamic_cast< UntypedMemberExpr * >( arg ) ) isConstExpr = false; 401 } 395 402 virtual void visit( LabelAddressExpr *labAddressExpr ) { isConstExpr = false; } 396 403 virtual void visit( UntypedMemberExpr *memberExpr ) { isConstExpr = false; } 397 404 virtual void visit( MemberExpr *memberExpr ) { isConstExpr = false; } 398 405 virtual void visit( VariableExpr *variableExpr ) { isConstExpr = false; } 399 virtual void visit( ConstantExpr *constantExpr ) { /* bottom out */ }400 406 // these might be okay? 401 407 // virtual void visit( SizeofExpr *sizeofExpr );
Note: See TracChangeset
for help on using the changeset viewer.