Changes in / [6726a3a:d677355]
- Files:
-
- 1 deleted
- 39 edited
-
doc/theses/thierry_delisle_PhD/thesis/text/existing.tex (modified) (2 diffs)
-
doc/theses/thierry_delisle_PhD/thesis/text/io.tex (modified) (8 diffs)
-
src/AST/Expr.cpp (modified) (1 diff)
-
src/CodeGen/FixNames.cc (modified) (4 diffs)
-
src/CodeGen/FixNames.h (modified) (2 diffs)
-
src/Concurrency/Keywords.h (modified) (1 diff)
-
src/ControlStruct/ExceptDecl.cc (modified) (1 diff)
-
src/ControlStruct/ExceptDecl.h (modified) (2 diffs)
-
src/ControlStruct/ExceptDeclNew.cpp (deleted)
-
src/ControlStruct/HoistControlDecls.hpp (modified) (1 diff)
-
src/ControlStruct/MultiLevelExit.cpp (modified) (6 diffs)
-
src/ControlStruct/module.mk (modified) (1 diff)
-
src/InitTweak/GenInit.cc (modified) (1 diff)
-
src/InitTweak/GenInit.h (modified) (2 diffs)
-
src/Tuples/Tuples.cc (modified) (1 diff)
-
src/Tuples/Tuples.h (modified) (1 diff)
-
src/Validate/Autogen.hpp (modified) (1 diff)
-
src/Validate/CompoundLiteral.hpp (modified) (1 diff)
-
src/Validate/EnumAndPointerDecay.cpp (modified) (1 diff)
-
src/Validate/EnumAndPointerDecay.hpp (modified) (2 diffs)
-
src/Validate/FindSpecialDecls.h (modified) (2 diffs)
-
src/Validate/FixQualifiedTypes.cpp (modified) (2 diffs)
-
src/Validate/FixQualifiedTypes.hpp (modified) (2 diffs)
-
src/Validate/FixReturnTypes.cpp (modified) (1 diff)
-
src/Validate/FixReturnTypes.hpp (modified) (2 diffs)
-
src/Validate/ForallPointerDecay.hpp (modified) (1 diff)
-
src/Validate/GenericParameter.cpp (modified) (1 diff)
-
src/Validate/GenericParameter.hpp (modified) (2 diffs)
-
src/Validate/HoistStruct.hpp (modified) (1 diff)
-
src/Validate/HoistTypeDecls.cpp (modified) (1 diff)
-
src/Validate/HoistTypeDecls.hpp (modified) (2 diffs)
-
src/Validate/LabelAddressFixer.cpp (modified) (1 diff)
-
src/Validate/LabelAddressFixer.hpp (modified) (2 diffs)
-
src/Validate/LinkReferenceToTypes.hpp (modified) (1 diff)
-
src/Validate/ReplaceTypedef.cpp (modified) (1 diff)
-
src/Validate/ReplaceTypedef.hpp (modified) (2 diffs)
-
src/Validate/VerifyCtorDtorAssign.cpp (modified) (1 diff)
-
src/Validate/VerifyCtorDtorAssign.hpp (modified) (2 diffs)
-
src/Virtual/Tables.h (modified) (1 diff)
-
src/main.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/thesis/text/existing.tex
r6726a3a rd677355 14 14 15 15 \section{Naming Convention} 16 Scheduling has been studied by various communities concentrating on different incarnation of the same problems. 17 As a result, there are no standard naming conventions for scheduling that is respected across these communities. 18 This document uses the term \newterm{\Gls{at}} to refer to the abstract objects being scheduled and the term \newterm{\Gls{proc}} to refer to the concrete objects executing these \ats. 16 Scheduling has been studied by various communities concentrating on different incarnation of the same problems. As a result, there are no standard naming conventions for scheduling that is respected across these communities. This document uses the term \newterm{\Gls{at}} to refer to the abstract objects being scheduled and the term \newterm{\Gls{proc}} to refer to the concrete objects executing these \ats. 19 17 20 18 \section{Static Scheduling} … … 28 26 \section{Dynamic Scheduling} 29 27 \newterm{Dynamic schedulers} determine \ats dependencies and costs during scheduling, if at all. 30 Hence, unlike static scheduling, \ats dependencies are conditional and detected at runtime. 31 This detection takes the form of observing new \ats(s) in the system and determining dependencies from their behaviour, including suspending or halting a \ats that dynamically detects unfulfilled dependencies. 28 Hence, unlike static scheduling, \ats dependencies are conditional and detected at runtime. This detection takes the form of observing new \ats(s) in the system and determining dependencies from their behaviour, including suspending or halting a \ats that dynamically detects unfulfilled dependencies. 32 29 Furthermore, each \ats has the responsibility of adding dependent \ats back into the system once dependencies are fulfilled. 33 30 As a consequence, the scheduler often has an incomplete view of the system, seeing only \ats with no pending dependencies. -
doc/theses/thierry_delisle_PhD/thesis/text/io.tex
r6726a3a rd677355 1 1 \chapter{User Level \io} 2 As mentioned in Section~\ref{prev:io}, user- level \io requires multiplexing the \io operations of many \glspl{thrd} onto fewer \glspl{proc} using asynchronous \io operations.2 As mentioned in Section~\ref{prev:io}, user-Level \io requires multiplexing the \io operations of many \glspl{thrd} onto fewer \glspl{proc} using asynchronous \io operations. 3 3 Different operating systems offer various forms of asynchronous operations and, as mentioned in Chapter~\ref{intro}, this work is exclusively focused on the Linux operating-system. 4 4 … … 72 72 73 73 \paragraph{\lstinline{poll}} is the next oldest option, and takes as input an array of structures containing the FD numbers rather than their position in an array of bits, allowing a more compact input for interest sets that contain widely spaced FDs. 74 For small interest sets with densely packed FDs, the @select@ bit mask can take less storage, and hence, copy less information into the kernel. 74 (For small interest sets with densely packed FDs, the @select@ bit mask can take less storage, and hence, copy less information into the kernel.) 75 75 Furthermore, @poll@ is non-destructive, so the array of structures does not have to be re-initialize on every call. 76 76 Like @select@, @poll@ suffers from the limitation that the interest set cannot be changed by other \gls{kthrd}, while a manager thread is blocked in @poll@. … … 277 277 While this example is artificial, in the presence of many \glspl{thrd}, it is possible for this problem to arise ``in the wild''. 278 278 Furthermore, this pattern is difficult to reliably detect and avoid. 279 Once in this situation, the only escape is to interrupted the spinning \gls{thrd}, either directly or via some regular preemption , \eg time slicing.279 Once in this situation, the only escape is to interrupted the spinning \gls{thrd}, either directly or via some regular preemption (\eg time slicing). 280 280 Having to interrupt \glspl{thrd} for this purpose is costly, the latency can be large between interrupts, and the situation may be hard to detect. 281 % However, a more important reason why interrupting the \gls{thrd} is not a satisfying solution is that the \gls{proc} is using the instance it is tied to. 282 % If it were to use it, then helping could be done as part of the usage. 281 283 Interrupts are needed here entirely because the \gls{proc} is tied to an instance it is not using. 282 284 Therefore, a more satisfying solution is for the \gls{thrd} submitting the operation to notice that the instance is unused and simply go ahead and use it. … … 299 301 Free SQEs, \ie, SQEs that are not currently being used to represent a request, can be written to safely and have a field called @user_data@ that the kernel only reads to copy to @cqe@s. 300 302 Allocation also requires no ordering guarantee as all free SQEs are interchangeable. 303 % This requires a simple concurrent bag. 301 304 The only added complexity is that the number of SQEs is fixed, which means allocation can fail. 302 305 … … 307 310 308 311 Once an SQE is filled in, it is added to the submission ring buffer, an operation that is not thread-safe, and then the kernel must be notified using the @io_uring_enter@ system call. 309 The submission ring buffer is the same size as the pre-allocated SQE buffer, therefore pushing to the ring buffer cannot fail because it would mean a \lstinline{sqe} multiple times in the ring buffer, which is undefined behaviour.312 The submission ring buffer is the same size as the pre-allocated SQE buffer, therefore pushing to the ring buffer cannot fail because it is invalid to have the same \lstinline{sqe} multiple times in a ring buffer. 310 313 However, as mentioned, the system call itself can fail with the expectation that it can be retried once some submitted operations complete. 311 314 … … 343 346 While instance borrowing looks similar to work sharing and stealing, I think it is different enough to warrant a different verb to avoid confusion.} 344 347 345 In this approach, each cluster , see Figure~\ref{fig:system},owns a pool of @io_uring@ instances managed by an \newterm{arbiter}.348 In this approach, each cluster (see Figure~\ref{fig:system}) owns a pool of @io_uring@ instances managed by an \newterm{arbiter}. 346 349 When a \gls{thrd} attempts to issue an \io operation, it ask for an instance from the arbiter and issues requests to that instance. 347 350 This instance is now bound to the \gls{proc} the \gls{thrd} is running on. 348 351 This binding is kept until the arbiter decides to revoke it, taking back the instance and reverting the \gls{proc} to its initial state with respect to \io. 349 352 This tight coupling means that synchronization can be minimal since only one \gls{proc} can use the instance at a time, akin to the private instances approach. 350 However, it differs in that revocation by the arbiter means this approach does not suffer from the deadlock scenario described above.353 However, it differs in that revocation by the arbiter (an interrupt) means this approach does not suffer from the deadlock scenario described above. 351 354 352 355 Arbitration is needed in the following cases: … … 374 377 375 378 \paragraph{External Submissions} are handled by the arbiter by revoking the appropriate instance and adding the submission to the submission ring. 376 However, there is no need to immediately revoke the instance.379 However, there is no need to immediately revoke the instance. 377 380 External submissions must simply be added to the ring before the next system call, \ie, when the submission ring is flushed. 378 381 This means whoever is responsible for the system call, first checks if the instance has any external submissions. … … 450 453 451 454 \section{Interface} 455 452 456 The last important part of the \io subsystem is its interface. 453 457 There are multiple approaches that can be offered to programmers, each with advantages and disadvantages. -
src/AST/Expr.cpp
r6726a3a rd677355 272 272 // Adjust the length of the string for the terminator. 273 273 const Expr * strSize = from_ulong( loc, str.size() + 1 ); 274 const Type * strType = new ArrayType( charType, strSize, FixedLen, DynamicDim );274 const Type * strType = new ArrayType( charType, strSize, FixedLen, StaticDim ); 275 275 const std::string strValue = "\"" + str + "\""; 276 276 return new ConstantExpr( loc, strType, strValue, std::nullopt ); -
src/CodeGen/FixNames.cc
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixNames.cc -- Adjustments to typed declarations.7 // FixNames.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jul 20 11:49:00 202213 // Update Count : 2 412 // Last Modified On : Fri Oct 29 15:49:00 2021 13 // Update Count : 23 14 14 // 15 15 … … 87 87 88 88 /// Does work with the main function and scopeLevels. 89 class FixNames_new final{89 class FixNames_new : public ast::WithGuards { 90 90 int scopeLevel = 1; 91 91 … … 103 103 104 104 const ast::FunctionDecl *postvisit( const ast::FunctionDecl *functionDecl ) { 105 // This store is used to ensure a maximum of one call to mutate. 106 ast::FunctionDecl * mutDecl = nullptr; 107 108 if ( shouldSetScopeLevel( functionDecl ) ) { 109 mutDecl = ast::mutate( functionDecl ); 110 mutDecl->scopeLevel = scopeLevel; 111 } 112 105 113 if ( FixMain::isMain( functionDecl ) ) { 106 auto mutDecl = ast::mutate( functionDecl ); 107 108 if ( shouldSetScopeLevel( mutDecl ) ) { 109 mutDecl->scopeLevel = scopeLevel; 110 } 114 if ( !mutDecl ) { mutDecl = ast::mutate( functionDecl ); } 111 115 112 116 int nargs = mutDecl->params.size(); … … 120 124 ) 121 125 ); 122 123 return mutDecl;124 } else if ( shouldSetScopeLevel( functionDecl ) ) {125 return ast::mutate_field( functionDecl, &ast::FunctionDecl::scopeLevel, scopeLevel );126 } else {127 return functionDecl;128 126 } 127 return mutDecl ? mutDecl : functionDecl; 129 128 } 130 129 131 130 void previsit( const ast::CompoundStmt * ) { 132 scopeLevel += 1; 133 } 134 135 void postvisit( const ast::CompoundStmt * ) { 136 scopeLevel -= 1; 131 GuardValue( scopeLevel ) += 1; 137 132 } 138 133 }; -
src/CodeGen/FixNames.h
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixNames.h -- Adjustments to typed declarations.7 // FixNames.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 26 26 /// mangles object and function names 27 27 void fixNames( std::list< Declaration* > & translationUnit ); 28 /// Sets scope levels and fills in main's default return. 29 void fixNames( ast::TranslationUnit & translationUnit ); 28 void fixNames( ast::TranslationUnit & translationUnit ); 30 29 } // namespace CodeGen 31 30 -
src/Concurrency/Keywords.h
r6726a3a rd677355 28 28 void implementThreadStarter( std::list< Declaration * > & translationUnit ); 29 29 30 /// Implement the sue-like keywords and the suspend keyword. Pre-Autogen30 /// Implement the sue-like keywords and the suspend keyword. 31 31 void implementKeywords( ast::TranslationUnit & translationUnit ); 32 /// Implement the mutex parameters and mutex statement. Post-Autogen32 /// Implement the mutex parameters and mutex statement. 33 33 void implementMutex( ast::TranslationUnit & translationUnit ); 34 /// Add the thread starter code to constructors. Post-Autogen34 /// Add the thread starter code to constructors. 35 35 void implementThreadStarter( ast::TranslationUnit & translationUnit ); 36 36 }; -
src/ControlStruct/ExceptDecl.cc
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ExceptDecl.cc -- Handles declarations of exception types.7 // ExceptDecl.cc -- 8 8 // 9 9 // Author : Henry Xue -
src/ControlStruct/ExceptDecl.h
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ExceptDecl.h -- Handles declarations of exception types.7 // ExceptDecl.h -- 8 8 // 9 9 // Author : Henry Xue 10 10 // Created On : Tue Jul 20 04:10:50 2021 11 // Last Modified By : Andrew Beach12 // Last Modified On : Tue Jul 12 15:49:00 202213 // Update Count : 211 // Last Modified By : Henry Xue 12 // Last Modified On : Tue Jul 20 04:10:50 2021 13 // Update Count : 1 14 14 // 15 15 … … 20 20 class Declaration; 21 21 22 namespace ast {23 class TranslationUnit;22 namespace ControlStruct { 23 void translateExcept( std::list< Declaration *> & translationUnit ); 24 24 } 25 26 namespace ControlStruct {27 /// Unfold exception declarations into raw structure declarations.28 /// Also builds vtable declarations and converts vtable types.29 void translateExcept( std::list< Declaration *> & translationUnit );30 void translateExcept( ast::TranslationUnit & translationUnit );31 } -
src/ControlStruct/HoistControlDecls.hpp
r6726a3a rd677355 21 21 22 22 namespace ControlStruct { 23 /// Hoist declarations out of control flow statements into compound statement. 24 /// Must happen before auto-gen routines are added. 23 // Hoist declarations out of control flow statements into compound statement. 25 24 void hoistControlDecls( ast::TranslationUnit & translationUnit ); 26 25 } // namespace ControlStruct -
src/ControlStruct/MultiLevelExit.cpp
r6726a3a rd677355 149 149 }; 150 150 151 NullStmt * labelledNullStmt( const CodeLocation & cl, const Label & label ) { 151 NullStmt * labelledNullStmt( 152 const CodeLocation & cl, const Label & label ) { 152 153 return new NullStmt( cl, vector<Label>{ label } ); 153 154 } … … 163 164 164 165 const CompoundStmt * MultiLevelExitCore::previsit( 165 const CompoundStmt * stmt ) {166 const CompoundStmt * stmt ) { 166 167 visit_children = false; 167 168 … … 188 189 } 189 190 190 size_t getUnusedIndex( const Stmt * stmt, const Label & originalTarget ) { 191 size_t getUnusedIndex( 192 const Stmt * stmt, const Label & originalTarget ) { 191 193 const size_t size = stmt->labels.size(); 192 194 … … 208 210 } 209 211 210 const Stmt * addUnused( const Stmt * stmt, const Label & originalTarget ) { 212 const Stmt * addUnused( 213 const Stmt * stmt, const Label & originalTarget ) { 211 214 size_t i = getUnusedIndex( stmt, originalTarget ); 212 215 if ( i == stmt->labels.size() ) { … … 353 356 354 357 // Mimic what the built-in push_front would do anyways. It is O(n). 355 void push_front( vector<ptr<Stmt>> & vec, const Stmt * element ) { 358 void push_front( 359 vector<ptr<Stmt>> & vec, const Stmt * element ) { 356 360 vec.emplace_back( nullptr ); 357 361 for ( size_t i = vec.size() - 1 ; 0 < i ; --i ) { … … 586 590 587 591 ptr<Stmt> else_stmt = nullptr; 588 constStmt * loop_kid = nullptr;592 Stmt * loop_kid = nullptr; 589 593 // check if loop node and if so add else clause if it exists 590 const WhileDoStmt * whilePtr = kid.as<WhileDoStmt>();591 if ( whilePtr && whilePtr->else_ ) {594 const WhileDoStmt * whilePtr = dynamic_cast<const WhileDoStmt *>(kid.get()); 595 if ( whilePtr && whilePtr->else_) { 592 596 else_stmt = whilePtr->else_; 593 loop_kid = mutate_field( whilePtr, &WhileDoStmt::else_, nullptr ); 594 } 595 const ForStmt * forPtr = kid.as<ForStmt>(); 596 if ( forPtr && forPtr->else_ ) { 597 WhileDoStmt * mutate_ptr = mutate(whilePtr); 598 mutate_ptr->else_ = nullptr; 599 loop_kid = mutate_ptr; 600 } 601 const ForStmt * forPtr = dynamic_cast<const ForStmt *>(kid.get()); 602 if ( forPtr && forPtr->else_) { 597 603 else_stmt = forPtr->else_; 598 loop_kid = mutate_field( forPtr, &ForStmt::else_, nullptr ); 604 ForStmt * mutate_ptr = mutate(forPtr); 605 mutate_ptr->else_ = nullptr; 606 loop_kid = mutate_ptr; 599 607 } 600 608 -
src/ControlStruct/module.mk
r6726a3a rd677355 17 17 SRC += \ 18 18 ControlStruct/ExceptDecl.cc \ 19 ControlStruct/ExceptDeclNew.cpp \20 19 ControlStruct/ExceptDecl.h \ 21 20 ControlStruct/ExceptTranslateNew.cpp \ -
src/InitTweak/GenInit.cc
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenInit.cc -- Generate initializers, and other stuff.7 // GenInit.cc -- 8 8 // 9 9 // Author : Rob Schluntz -
src/InitTweak/GenInit.h
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenInit.h -- Generate initializers, and other stuff.7 // GenInit.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 29 29 void genInit( ast::TranslationUnit & translationUnit ); 30 30 31 /// Converts return statements into copy constructor calls on the hidden return variable. 32 /// This pass must happen before auto-gen. 31 /// Converts return statements into copy constructor calls on the hidden return variable 33 32 void fixReturnStatements( std::list< Declaration * > & translationUnit ); 34 33 void fixReturnStatements( ast::TranslationUnit & translationUnit ); -
src/Tuples/Tuples.cc
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Tuples. cc -- A collection of tuple operations.7 // Tuples.h -- 8 8 // 9 9 // Author : Andrew Beach -
src/Tuples/Tuples.h
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Tuples.h -- A collection of tuple operations.7 // Tuples.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves -
src/Validate/Autogen.hpp
r6726a3a rd677355 22 22 namespace Validate { 23 23 24 /// Generate routines for all data types in the translation unit.25 /// A lot of passes have to happen either before or after this pass.26 24 void autogenerateRoutines( ast::TranslationUnit & translationUnit ); 27 25 -
src/Validate/CompoundLiteral.hpp
r6726a3a rd677355 23 23 24 24 /// Use variables to implement compound literals. 25 /// Must happen after auto-gen routines are added.26 25 void handleCompoundLiterals( ast::TranslationUnit & translationUnit ); 27 26 -
src/Validate/EnumAndPointerDecay.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // EnumAndPointerDecay.cpp -- Normalizes enumerations and types in functions.7 // EnumAndPointerDecay.cpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/EnumAndPointerDecay.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // EnumAndPointerDecay.hpp -- Normalizes enumerations and types in functions.7 // EnumAndPointerDecay.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 22 22 namespace Validate { 23 23 24 /// Fix the parameter and return types of functions. Also assigns types to25 /// enumeration values. This must happen before Link Reference to Types,26 /// it needs correct types for mangling, and before auto-gen.27 24 void decayEnumsAndPointers( ast::TranslationUnit & translationUnit ); 28 25 -
src/Validate/FindSpecialDecls.h
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FindSpecialDeclarations.h -- Find special declarations used in the compiler.7 // FindSpecialDeclarations.h -- 8 8 // 9 9 // Author : Rob Schluntz … … 43 43 void findSpecialDecls( std::list< Declaration * > & translationUnit ); 44 44 45 /// Find and remember some of the special declarations that are useful for45 /// find and remember some of the special declarations that are useful for 46 46 /// generating code, so that they do not have to be discovered multiple times. 47 47 void findGlobalDecls( ast::TranslationUnit & translationUnit ); -
src/Validate/FixQualifiedTypes.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixQualifiedTypes.cpp -- Replace the qualified type with a direct type.7 // FixQualifiedTypes.cpp -- 8 8 // 9 9 // Author : Andrew Beach … … 76 76 ret->qualifiers = type->qualifiers; 77 77 ast::TypeSubstitution sub( aggr->params, instp->params ); 78 // = parent->genericSubstitution(); 78 79 auto result = sub.apply(ret); 79 80 return result.node.release(); -
src/Validate/FixQualifiedTypes.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixQualifiedTypes.hpp -- Replace the qualified type with a direct type.7 // FixQualifiedTypes.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 22 22 namespace Validate { 23 23 24 /// Replaces qualified types with an unqualified NamedTypeDecl.25 /// Must happen after Link References To Types,26 /// because aggregate members are accessed.27 24 void fixQualifiedTypes( ast::TranslationUnit & translationUnit ); 28 25 -
src/Validate/FixReturnTypes.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixReturnTypes.cpp -- Unifies the representation of return types.7 // FixReturnTypes.cpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/FixReturnTypes.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixReturnTypes.hpp -- Unifies the representation of return types.7 // FixReturnTypes.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 22 22 namespace Validate { 23 23 24 /// This pass needs to happen early so that other passes can find tuple types 25 /// in the right places, especially for function return types. 26 /// Must happen before auto-gen. 24 // This pass needs to happen early so that other passes can find tuple types 25 // in the right places, especially for function return types. 27 26 void fixReturnTypes( ast::TranslationUnit & translationUnit ); 28 27 -
src/Validate/ForallPointerDecay.hpp
r6726a3a rd677355 29 29 /// Also checks that operator names are used properly on functions and 30 30 /// assigns unique IDs. This is a "legacy" pass. 31 /// Must be after implement concurrent keywords; because uniqueIds must be32 /// set on declaration before resolution.33 /// Must happen before auto-gen routines are added.34 31 void decayForallPointers( ast::TranslationUnit & transUnit ); 35 32 -
src/Validate/GenericParameter.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenericParameter.hpp -- Generic parameter related passes.7 // GenericParameter.hpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/GenericParameter.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // GenericParameter.hpp -- Generic parameter related passes.7 // GenericParameter.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 23 23 24 24 /// Perform substutions for generic parameters and fill in defaults. 25 /// Check as early as possible, but it can't happen before Link References to26 /// Types and observed failing when attempted before eliminate typedef.27 25 void fillGenericParameters( ast::TranslationUnit & translationUnit ); 28 26 -
src/Validate/HoistStruct.hpp
r6726a3a rd677355 22 22 namespace Validate { 23 23 24 /// Flattens nested type declarations. (Run right after Fix Qualified Types.)24 /// Flattens nested type declarations. 25 25 void hoistStruct( ast::TranslationUnit & translationUnit ); 26 26 -
src/Validate/HoistTypeDecls.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // HoistTypeDecls.cpp -- Hoists declarations of implicitly declared types.7 // HoistTypeDecls.cpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/HoistTypeDecls.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // HoistTypeDecls.hpp -- Hoists declarations of implicitly declared types.7 // HoistTypeDecls.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 22 22 namespace Validate { 23 23 24 /// There are some places where a type can be declared but are usually only25 /// referenced (with an *InstType). This inserts the declarations before26 /// they are referenced.27 24 void hoistTypeDecls( ast::TranslationUnit & translationUnit ); 28 25 -
src/Validate/LabelAddressFixer.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // LabelAddressFixer.cpp -- Create label address expressions.7 // LabelAddressFixer.cpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/LabelAddressFixer.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // LabelAddressFixer.hpp -- Create label address expressions.7 // LabelAddressFixer.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 20 20 namespace Validate { 21 21 22 /// Label addresses are not actually created in the parser, this pass finds23 /// the patterns that represent the label address expression.24 22 void fixLabelAddresses( ast::TranslationUnit & translationUnit ); 25 23 -
src/Validate/LinkReferenceToTypes.hpp
r6726a3a rd677355 22 22 namespace Validate { 23 23 24 /// Fills in the base value of various instance types, and some related25 /// adjustments, such as setting the sized flag.26 /// Because of the sized flag, it must happen before auto-gen.27 24 void linkReferenceToTypes( ast::TranslationUnit & translationUnit ); 28 25 -
src/Validate/ReplaceTypedef.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ReplaceTypedef.cpp -- Fill in all typedefs with the underlying type.7 // ReplaceTypedef.cpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/ReplaceTypedef.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ReplaceTypedef.hpp -- Fill in all typedefs with the underlying type.7 // ReplaceTypedef.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 22 22 namespace Validate { 23 23 24 /// Uses of typedef are replaced with the type in the typedef.25 24 void replaceTypedef( ast::TranslationUnit & translationUnit ); 26 25 -
src/Validate/VerifyCtorDtorAssign.cpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // VerifyCtorDtorAssign.cpp -- Check the form of operators.7 // VerifyCtorDtorAssign.cpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/VerifyCtorDtorAssign.hpp
r6726a3a rd677355 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // VerifyCtorDtorAssign.hpp -- Check the form of operators.7 // VerifyCtorDtorAssign.hpp -- 8 8 // 9 9 // Author : Andrew Beach … … 22 22 namespace Validate { 23 23 24 /// Check that constructors, destructors and assignments all have the correct25 /// form. Must happen before auto-gen or anything that examines operators.26 24 void verifyCtorDtorAssign( ast::TranslationUnit & translationUnit ); 27 25 -
src/Virtual/Tables.h
r6726a3a rd677355 19 19 #include "AST/Fwd.hpp" 20 20 class Declaration; 21 class StructDecl; 21 22 class Expression; 22 class FunctionDecl;23 class Initializer;24 class ObjectDecl;25 class StructDecl;26 class StructInstType;27 class Type;28 23 29 24 namespace Virtual { -
src/main.cc
r6726a3a rd677355 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jul 18 11:08:00 202213 // Update Count : 67 612 // Last Modified On : Tue Jul 12 12:02:00 2022 13 // Update Count : 675 14 14 // 15 15 … … 330 330 Stats::Time::StopBlock(); 331 331 332 PASS( "Translate Exception Declarations", ControlStruct::translateExcept( translationUnit ) ); 333 if ( exdeclp ) { 334 dump( translationUnit ); 335 return EXIT_SUCCESS; 336 } // if 337 338 CodeTools::fillLocations( translationUnit ); 339 332 340 if( useNewAST ) { 341 CodeTools::fillLocations( translationUnit ); 342 333 343 if (Stats::Counters::enabled) { 334 344 ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New"); … … 339 349 forceFillCodeLocations( transUnit ); 340 350 341 PASS( "Translate Exception Declarations", ControlStruct::translateExcept( transUnit ) ); 342 if ( exdeclp ) { 343 dump( move( transUnit ) ); 344 return EXIT_SUCCESS; 345 } 346 351 // Must happen before auto-gen, or anything that examines ops. 347 352 PASS( "Verify Ctor, Dtor & Assign", Validate::verifyCtorDtorAssign( transUnit ) ); 353 348 354 PASS( "Hoist Type Decls", Validate::hoistTypeDecls( transUnit ) ); 349 355 // Hoist Type Decls pulls some declarations out of contexts where … … 353 359 354 360 PASS( "Replace Typedefs", Validate::replaceTypedef( transUnit ) ); 361 362 // Must happen before auto-gen. 355 363 PASS( "Fix Return Types", Validate::fixReturnTypes( transUnit ) ); 364 365 // Must happen before Link Reference to Types, it needs correct 366 // types for mangling. 356 367 PASS( "Enum and Pointer Decay", Validate::decayEnumsAndPointers( transUnit ) ); 357 368 369 // Must happen before auto-gen, because it uses the sized flag. 358 370 PASS( "Link Reference To Types", Validate::linkReferenceToTypes( transUnit ) ); 359 371 372 // Must happen after Link References To Types, 373 // because aggregate members are accessed. 360 374 PASS( "Fix Qualified Types", Validate::fixQualifiedTypes( transUnit ) ); 375 361 376 PASS( "Hoist Struct", Validate::hoistStruct( transUnit ) ); 362 377 PASS( "Eliminate Typedef", Validate::eliminateTypedef( transUnit ) ); 378 379 // Check as early as possible. Can't happen before 380 // LinkReferenceToType, observed failing when attempted 381 // before eliminateTypedef 363 382 PASS( "Validate Generic Parameters", Validate::fillGenericParameters( transUnit ) ); 383 364 384 PASS( "Translate Dimensions", Validate::translateDimensionParameters( transUnit ) ); 365 385 PASS( "Check Function Returns", Validate::checkReturnStatements( transUnit ) ); 386 387 // Must happen before Autogen. 366 388 PASS( "Fix Return Statements", InitTweak::fixReturnStatements( transUnit ) ); 389 367 390 PASS( "Implement Concurrent Keywords", Concurrency::implementKeywords( transUnit ) ); 391 392 // Must be after implement concurrent keywords; because uniqueIds 393 // must be set on declaration before resolution. 394 // Must happen before autogen routines are added. 368 395 PASS( "Forall Pointer Decay", Validate::decayForallPointers( transUnit ) ); 396 397 // Must happen before autogen routines are added. 369 398 PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls( transUnit ) ); 370 399 400 // Must be after enum and pointer decay. 401 // Must be before compound literals. 371 402 PASS( "Generate Autogen Routines", Validate::autogenerateRoutines( transUnit ) ); 372 403 … … 442 473 translationUnit = convert( move( transUnit ) ); 443 474 } else { 444 PASS( "Translate Exception Declarations", ControlStruct::translateExcept( translationUnit ) );445 if ( exdeclp ) {446 dump( translationUnit );447 return EXIT_SUCCESS;448 } // if449 450 475 // add the assignment statement after the initialization of a type parameter 451 476 PASS( "Validate", SymTab::validate( translationUnit ) );
Note:
See TracChangeset
for help on using the changeset viewer.