Changeset 32cab5b for src/Common
- Timestamp:
- Apr 17, 2018, 12:01:09 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 3265399
- Parents:
- b2fe1c9 (diff), 81bb114 (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. - Location:
- src/Common
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Debug.h
rb2fe1c9 r32cab5b 28 28 namespace Debug { 29 29 /// debug codegen a translation unit 30 static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {30 static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Compiler ) { 31 31 #ifdef DEBUG 32 32 std::list< Declaration * > decls; 33 33 34 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [ ]( Declaration * decl ) {35 return ! LinkageSpec::isBuiltin( decl->get_linkage());34 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) { 35 return ! (decl->linkage & linkageFilter); 36 36 }); 37 37 38 38 std::cerr << "======" << label << "======" << std::endl; 39 CodeGen::generate( decls, std::cerr, false, true );39 CodeGen::generate( decls, std::cerr, true, true ); 40 40 #endif 41 41 } // dump 42 42 43 static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {43 static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Compiler ) { 44 44 #ifdef DEBUG 45 45 std::list< Declaration * > decls; 46 46 47 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [ ]( Declaration * decl ) {48 return ! LinkageSpec::isBuiltin( decl->get_linkage());47 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) { 48 return ! (decl->linkage & linkageFilter); 49 49 }); 50 50 -
src/Common/ErrorObjects.h
rb2fe1c9 r32cab5b 35 35 class SemanticErrorException : public std::exception { 36 36 public: 37 37 SemanticErrorException() = default; 38 38 SemanticErrorException( CodeLocation location, std::string error ); 39 39 ~SemanticErrorException() throw() {} -
src/Common/PassVisitor.h
rb2fe1c9 r32cab5b 66 66 virtual void visit( TypedefDecl * typeDecl ) override final; 67 67 virtual void visit( AsmDecl * asmDecl ) override final; 68 virtual void visit( StaticAssertDecl * assertDecl ) override final; 68 69 69 70 virtual void visit( CompoundStmt * compoundStmt ) override final; … … 161 162 virtual Declaration * mutate( TypedefDecl * typeDecl ) override final; 162 163 virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final; 164 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) override final; 163 165 164 166 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final; -
src/Common/PassVisitor.impl.h
rb2fe1c9 r32cab5b 685 685 686 686 //-------------------------------------------------------------------------- 687 // StaticAssertDecl 688 template< typename pass_type > 689 void PassVisitor< pass_type >::visit( StaticAssertDecl * node ) { 690 VISIT_START( node ); 691 692 maybeAccept_impl( node->condition, *this ); 693 maybeAccept_impl( node->message , *this ); 694 695 VISIT_END( node ); 696 } 697 698 template< typename pass_type > 699 StaticAssertDecl * PassVisitor< pass_type >::mutate( StaticAssertDecl * node ) { 700 MUTATE_START( node ); 701 702 maybeMutate_impl( node->condition, *this ); 703 maybeMutate_impl( node->message , *this ); 704 705 MUTATE_END( StaticAssertDecl, node ); 706 } 707 708 //-------------------------------------------------------------------------- 687 709 // CompoundStmt 688 710 template< typename pass_type > … … 1490 1512 indexerScopedAccept( node->result, *this ); 1491 1513 maybeAccept_impl ( node->type , *this ); 1492 maybeAccept_impl ( node->member, *this );1493 1514 1494 1515 VISIT_END( node ); … … 1502 1523 indexerScopedMutate( node->result, *this ); 1503 1524 maybeMutate_impl ( node->type , *this ); 1504 maybeMutate_impl ( node->member, *this );1505 1525 1506 1526 MUTATE_END( Expression, node ); -
src/Common/SemanticError.h
rb2fe1c9 r32cab5b 38 38 constexpr const char * const WarningFormats[] = { 39 39 "self assignment of expression: %s", 40 "rvalue to reference conversion of rvalue: %s", 40 41 }; 41 42 42 43 enum class Warning { 43 44 SelfAssignment, 45 RvalueToReferenceConversion, 44 46 NUMBER_OF_WARNINGS, //This MUST be the last warning 45 47 }; … … 50 52 ); 51 53 52 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id], __VA_ARGS__) 54 // ## used here to allow empty __VA_ARGS__ 55 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id], ## __VA_ARGS__) 53 56 54 57 void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4)));
Note:
See TracChangeset
for help on using the changeset viewer.