# Changeset 72dc82a

Ignore:
Timestamp:
Mar 31, 2017, 12:21:52 PM (5 years ago)
Branches:
aaron-thesis, arm-eh, cleanup-dtors, 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, resolv-new, with_gc
Children:
78d3dd5
Parents:
690f13c (diff), 936a287 (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

Files:
17 edited

Unmodified
Removed
• ## doc/LaTeXmacros/common.tex

• ## doc/generic_types/generic_types.bib

 r690f13c } @techreport{C++Concepts, type = {International Standard}, keywords    = {ISO/IEC TS 19217:2015}, contributer = {a3moss@uwaterloo.ca}, key         = {{ISO/IEC} {TS} 19217}, title       = {Information technology -- Programming languages -- {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Extensions for concepts}, institution = {International Standard Organization}, address     = {http://www.iso.org}, year        = 2015 } @phdthesis{Ditchfield92, keywords    = {C, parametric polymorphism, overloading}, address     = {Waterloo, Ontario, Canada, N2L 3G1}, note        = {\href{http://plg.uwaterloo.ca/theses/DitchfieldThesis.pdf}{http://\-plg.uwaterloo.ca/\-theses/\-DitchfieldThesis.pdf}} } @article{Gro06, author = {Grossman, Dan}, title = {Quantified Types in an Imperative Language}, journal = {ACM Trans. Program. Lang. Syst.}, issue_date = {May 2006}, volume = {28}, number = {3}, month = may, year = {2006}, issn = {0164-0925}, pages = {429--475}, numpages = {47}, url = {http://doi.acm.org.proxy.lib.uwaterloo.ca/10.1145/1133651.1133653}, doi = {10.1145/1133651.1133653}, acmid = {1133653}, publisher = {ACM}, address = {New York, NY, USA}, }
• ## doc/generic_types/generic_types.tex

• ## doc/rob_thesis/ctordtor.tex

 r690f13c %   at the global scope (which is likely the most common case) % * [9] % Move semantics % * % Changes to polymorphic type classes
• ## doc/rob_thesis/tuples.tex

 r690f13c \end{cfacode} Note that due to flattening, @x@ used in the argument position is converted into the list of its fields. In the call to @f@, a the second and third argument components are structured into a tuple argument. In the call to @f@, the second and third argument components are structured into a tuple argument. Expressions which may contain side effects are made into \emph{unique expressions} before being expanded by the flattening conversion. \end{cfacode} Since argument evaluation order is not specified by the C programming language, this scheme is built to work regardless of evaluation order. The first time a unique expression is executed, the actual expression is evaluated and the accompanying boolean is true to true. The first time a unique expression is executed, the actual expression is evaluated and the accompanying boolean is set to true. Every subsequent evaluation of the unique expression then results in an access to the stored result of the actual expression. Thunks 0 through 3 provide wrappers for the @otype@ parameters for @const char *@, while @_thunk4@ translates a call to @print([int, const char *])@ into a call to @print_variadic(int, [const char *])@. This all builds to a call to @print_variadic@, with the appropriate copy construction of the tuple argument. \section{Future Work}
• ## src/CodeGen/CodeGenerator.cc

 r690f13c // Created On       : Mon May 18 07:44:20 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Fri Mar 17 09:06:01 2017 // Update Count     : 481 // Last Modified On : Thu Mar 30 16:38:01 2017 // Update Count     : 482 // void CodeGenerator::visit( CompoundLiteralExpr *compLitExpr ) { assert( compLitExpr->get_type() && dynamic_cast< ListInit * > ( compLitExpr->get_initializer() ) ); output << "(" << genType( compLitExpr->get_type(), "", pretty ) << ")"; assert( compLitExpr->get_result() && dynamic_cast< ListInit * > ( compLitExpr->get_initializer() ) ); output << "(" << genType( compLitExpr->get_result(), "", pretty ) << ")"; compLitExpr->get_initializer()->accept( *this ); }
• ## src/InitTweak/FixInit.cc

 r690f13c stmtsToAddAfter.push_back( ifStmt ); if ( ctorInit->get_dtor() ) { Statement * dtor = ctorInit->get_dtor(); objDecl->set_init( NULL ); ctorInit->set_ctor( NULL ); ctorInit->set_dtor( nullptr ); if ( dtor ) { // if the object has a non-trivial destructor, have to // hoist it and the object into the global space and // call the destructor function with atexit. Statement * dtorStmt = ctorInit->get_dtor()->clone(); Statement * dtorStmt = dtor->clone(); // void __objName_dtor_atexitN(...) {...} objDecl->set_mangleName( SymTab::Mangler::mangle( objDecl ) ); objDecl->set_init( NULL ); ctorInit->set_ctor( NULL ); delete ctorInit; // xxx - temporary hack: need to return a declaration, but want to hoist the current object out of this scope // create a new object which is never used static UniqueName dummyNamer( "_dummy" ); ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), Type::StorageClasses( Type::Static ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } ); delete ctorInit; return dummy; }
• ## src/InitTweak/GenInit.cc

 r690f13c handleDWT( objDecl ); // hands off if @=, extern, builtin, etc. // if global but initializer is not constexpr, always try to construct, since this is not legal C if ( ( tryConstruct( objDecl ) && isManaged( objDecl ) ) || (! inFunction && ! isConstExpr( objDecl->get_init() ) ) ) { // even if unmanaged, try to construct global or static if initializer is not constexpr, since this is not legal C if ( tryConstruct( objDecl ) && ( isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) { // constructed objects cannot be designated if ( isDesignated( objDecl->get_init() ) ) throw SemanticError( "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.", objDecl ); if ( isDesignated( objDecl->get_init() ) ) throw SemanticError( "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n", objDecl ); // constructed objects should not have initializers nested too deeply if ( ! checkInitDepth( objDecl ) ) throw SemanticError( "Managed object's initializer is too deep ", objDecl );
• ## src/Parser/ExpressionNode.cc

 r690f13c // Created On       : Sat May 16 13:17:07 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Sat Mar  4 06:58:47 2017 // Update Count     : 509 // Last Modified On : Thu Mar 30 17:02:46 2017 // Update Count     : 515 // // these types do not have associated type information } else if ( StructDecl * newDeclStructDecl = dynamic_cast< StructDecl * >( newDecl )  ) { return new CompoundLiteralExpr( new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() ), maybeMoveBuild< Initializer >(kids) ); if ( newDeclStructDecl->has_body() ) { return new CompoundLiteralExpr( new StructInstType( Type::Qualifiers(), newDeclStructDecl ), maybeMoveBuild< Initializer >(kids) ); } else { return new CompoundLiteralExpr( new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() ), maybeMoveBuild< Initializer >(kids) ); } // if } else if ( UnionDecl * newDeclUnionDecl = dynamic_cast< UnionDecl * >( newDecl )  ) { return new CompoundLiteralExpr( new UnionInstType( Type::Qualifiers(), newDeclUnionDecl->get_name() ), maybeMoveBuild< Initializer >(kids) ); if ( newDeclUnionDecl->has_body() ) { return new CompoundLiteralExpr( new UnionInstType( Type::Qualifiers(), newDeclUnionDecl ), maybeMoveBuild< Initializer >(kids) ); } else { return new CompoundLiteralExpr( new UnionInstType( Type::Qualifiers(), newDeclUnionDecl->get_name() ), maybeMoveBuild< Initializer >(kids) ); } // if } else if ( EnumDecl * newDeclEnumDecl = dynamic_cast< EnumDecl * >( newDecl )  ) { return new CompoundLiteralExpr( new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ), maybeMoveBuild< Initializer >(kids) ); if ( newDeclEnumDecl->has_body() ) { return new CompoundLiteralExpr( new EnumInstType( Type::Qualifiers(), newDeclEnumDecl ), maybeMoveBuild< Initializer >(kids) ); } else { return new CompoundLiteralExpr( new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ), maybeMoveBuild< Initializer >(kids) ); } // if } else { assert( false );
• ## src/Parser/parser.yy

 r690f13c // Created On       : Sat Sep  1 20:22:55 2001 // Last Modified By : Peter A. Buhr // Last Modified On : Fri Mar 17 15:42:22 2017 // Update Count     : 2317 // Last Modified On : Thu Mar 30 15:42:32 2017 // Update Count     : 2318 // | postfix_expression DECR { $$= new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, 1 ) ); } | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99 | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal {$$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode($5, true ) ) ); } | postfix_expression '{' argument_expression_list '}' // CFA
• ## src/SymTab/Indexer.cc

 r690f13c // Created On       : Sun May 17 21:37:33 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Tue Mar 14 08:07:34 2017 // Update Count     : 17 // Last Modified On : Thu Mar 30 16:38:47 2017 // Update Count     : 19 // void Indexer::visit( CompoundLiteralExpr *compLitExpr ) { acceptNewScope( compLitExpr->get_result(), *this ); maybeAccept( compLitExpr->get_type(), *this ); maybeAccept( compLitExpr->get_initializer(), *this ); }
• ## src/SymTab/Validate.cc

 r690f13c // Created On       : Sun May 17 21:50:04 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Thu Mar 16 16:39:15 2017 // Update Count     : 353 // Last Modified On : Thu Mar 30 16:50:13 2017 // Update Count     : 357 // CompoundLiteral compoundliteral; HoistStruct::hoistStruct( translationUnit ); EliminateTypedef::eliminateTypedef( translationUnit ); HoistStruct::hoistStruct( translationUnit ); ReturnTypeFixer::fix( translationUnit ); // must happen before autogen acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions static UniqueName indexName( "_compLit" ); ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storageClasses, LinkageSpec::C, 0, compLitExpr->get_type(), compLitExpr->get_initializer() ); compLitExpr->set_type( 0 ); ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storageClasses, LinkageSpec::C, 0, compLitExpr->get_result(), compLitExpr->get_initializer() ); compLitExpr->set_result( 0 ); compLitExpr->set_initializer( 0 ); delete compLitExpr;
• ## src/SynTree/Expression.cc

 r690f13c // Created On       : Mon May 18 07:44:20 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Fri Mar 17 09:42:04 2017 // Update Count     : 51 // Last Modified On : Thu Mar 30 16:41:13 2017 // Update Count     : 52 // CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : type( type ), initializer( initializer ) { CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : initializer( initializer ) { assert( type && initializer ); set_result( type->clone() ); } CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), type( other.type->clone() ), initializer( other.initializer->clone() ) {} set_result( type ); } CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), initializer( other.initializer->clone() ) {} CompoundLiteralExpr::~CompoundLiteralExpr() { delete initializer; delete type; } os << "Compound Literal Expression: " << std::endl; os << std::string( indent+2, ' ' ); type->print( os, indent + 2 ); get_result()->print( os, indent + 2 ); os << std::string( indent+2, ' ' ); initializer->print( os, indent + 2 );
• ## src/SynTree/Expression.h

 r690f13c // Created On       : Mon May 18 07:44:20 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Sat Jan 14 14:37:54 2017 // Update Count     : 37 // Last Modified On : Thu Mar 30 16:44:00 2017 // Update Count     : 41 // Type *& get_result() { return result; } const Type * get_result() const { return result; } void set_result( Type * newValue ) { result = newValue; } bool has_result() const { return result != nullptr; } virtual ~CompoundLiteralExpr(); Type * get_type() const { return type; } void set_type( Type * t ) { type = t; } Initializer * get_initializer() const { return initializer; } void set_initializer( Initializer * i ) { initializer = i; } virtual void print( std::ostream & os, int indent = 0 ) const; private: Type * type; Initializer * initializer; };
• ## src/SynTree/Mutator.cc

 r690f13c // Created On       : Mon May 18 07:44:20 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Thu Feb 16 15:02:23 2017 // Update Count     : 21 // Last Modified On : Thu Mar 30 16:45:19 2017 // Update Count     : 22 // compLitExpr->set_env( maybeMutate( compLitExpr->get_env(), *this ) ); compLitExpr->set_result( maybeMutate( compLitExpr->get_result(), *this ) ); compLitExpr->set_type( maybeMutate( compLitExpr->get_type(), *this ) ); compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) ); return compLitExpr;
• ## src/SynTree/Visitor.cc

 r690f13c // Created On       : Mon May 18 07:44:20 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Thu Feb 16 15:01:25 2017 // Update Count     : 23 // Last Modified On : Thu Mar 30 16:45:25 2017 // Update Count     : 24 // void Visitor::visit( CompoundLiteralExpr *compLitExpr ) { maybeAccept( compLitExpr->get_result(), *this ); maybeAccept( compLitExpr->get_type(), *this ); maybeAccept( compLitExpr->get_initializer(), *this ); }
• ## src/libcfa/iostream.c

 r690f13c ostype * ?|?( ostype * os, const char * cp ) { enum { Open = 1, Close, OpenClose }; static const unsigned char mask[256] = { static const unsigned char mask[256] @= { // opening delimiters, no space after ['('] : Open, ['['] : Open, ['{'] : Open,
Note: See TracChangeset for help on using the changeset viewer.