Changes in / [bbfe226:70b4aeb9]


Ignore:
Files:
4 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/mutex_stmt.hfa

    rbbfe226 r70b4aeb9  
    3838    }
    3939
    40     struct scoped_lock {
    41         L * internal_lock;
    42     };
    43 
    44     static inline void ?{}( scoped_lock(L) & this, L & internal_lock ) {
    45         this.internal_lock = &internal_lock;
    46         lock(internal_lock);
    47     }
    48    
    49     static inline void ^?{}( scoped_lock(L) & this ) with(this) {
    50         unlock(*internal_lock);
    51     }
    52 
    5340    static inline L * __get_ptr( L & this ) {
    5441        return &this;
  • src/AST/Copy.hpp

    rbbfe226 r70b4aeb9  
    1010// Created On       : Wed Jul 10 16:13:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Dec 15 11:07:00 2021
    13 // Update Count     : 3
     12// Last Modified On : Thr Nov 11  9:22:00 2021
     13// Update Count     : 2
    1414//
    1515
     
    5252Node * deepCopy<Node>( const Node * localRoot );
    5353
    54 template<typename node_t, enum Node::ref_type ref_t>
    55 node_t * shallowCopy( const ptr_base<node_t, ref_t> & localRoot ) {
    56         return shallowCopy( localRoot.get() );
    57 }
    58 
    59 template<typename node_t, enum Node::ref_type ref_t>
    60 node_t * deepCopy( const ptr_base<node_t, ref_t> & localRoot ) {
    61         return deepCopy( localRoot.get() );
    62 }
    63 
    6454}
    6555
  • src/AST/Node.hpp

    rbbfe226 r70b4aeb9  
    188188        }
    189189
    190         ptr_base & operator=( const node_t * node ) {
    191                 assign( node );
    192                 return *this;
    193         }
    194 
    195190        template<typename o_node_t>
    196191        ptr_base & operator=( const o_node_t * node ) {
  • src/ControlStruct/module.mk

    rbbfe226 r70b4aeb9  
    2222        ControlStruct/ForExprMutator.cc \
    2323        ControlStruct/ForExprMutator.h \
    24         ControlStruct/HoistControlDecls.cpp \
    25         ControlStruct/HoistControlDecls.hpp \
    2624        ControlStruct/LabelFixer.cc \
    2725        ControlStruct/LabelFixer.h \
  • src/SymTab/Validate.cc

    rbbfe226 r70b4aeb9  
    453453        }
    454454
    455         void decayForallPointers( std::list< Declaration * > & translationUnit ) {
    456                 PassVisitor<ForallPointerDecay_old> fpd;
    457                 acceptAll( translationUnit, fpd );
    458         }
    459 
    460455        void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    461456                validate_A( translationUnit );
     
    475470                type->accept( fpd );
    476471        }
     472
    477473
    478474        void HoistTypeDecls::handleType( Type * type ) {
  • src/SymTab/Validate.h

    rbbfe226 r70b4aeb9  
    4242        void validate_E( std::list< Declaration * > &translationUnit );
    4343        void validate_F( std::list< Declaration * > &translationUnit );
    44         void decayForallPointers( std::list< Declaration * > & translationUnit );
    4544
    4645        const ast::Type * validateType(
  • src/Validate/module.mk

    rbbfe226 r70b4aeb9  
    1616
    1717SRC_VALIDATE = \
    18         Validate/Autogen.cpp \
    19         Validate/Autogen.hpp \
    2018        Validate/CompoundLiteral.cpp \
    2119        Validate/CompoundLiteral.hpp \
  • src/main.cc

    rbbfe226 r70b4aeb9  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jan 26 14:09:00 2022
    13 // Update Count     : 670
     12// Last Modified On : Tue Nov 30 10:25:00 2021
     13// Update Count     : 659
    1414//
    1515
     
    5555#include "ControlStruct/ExceptTranslate.h"  // for translateEHM
    5656#include "ControlStruct/FixLabels.hpp"      // for fixLabels
    57 #include "ControlStruct/HoistControlDecls.hpp" //  hoistControlDecls
    5857#include "ControlStruct/Mutate.h"           // for mutate
    5958#include "GenPoly/Box.h"                    // for box
     
    7473#include "SynTree/Visitor.h"                // for acceptAll
    7574#include "Tuples/Tuples.h"                  // for expandMemberTuples, expan...
    76 #include "Validate/Autogen.hpp"             // for autogenerateRoutines
    7775#include "Validate/FindSpecialDecls.h"      // for findGlobalDecls
    7876#include "Validate/CompoundLiteral.hpp"     // for handleCompoundLiterals
     
    8078#include "Validate/LabelAddressFixer.hpp"   // for fixLabelAddresses
    8179#include "Virtual/ExpandCasts.h"            // for expandCasts
     80
    8281
    8382static void NewPass( const char * const name ) {
     
    327326                PASS( "Validate-B", SymTab::validate_B( translationUnit ) );
    328327                PASS( "Validate-C", SymTab::validate_C( translationUnit ) );
     328                PASS( "Validate-D", SymTab::validate_D( translationUnit ) );
    329329
    330330                CodeTools::fillLocations( translationUnit );
    331331
    332332                if( useNewAST ) {
    333                         PASS( "Apply Concurrent Keywords", Concurrency::applyKeywords( translationUnit ) );
    334                         PASS( "Forall Pointer Decay", SymTab::decayForallPointers( translationUnit ) );
    335                         CodeTools::fillLocations( translationUnit );
    336 
    337333                        if (Stats::Counters::enabled) {
    338334                                ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New");
     
    342338
    343339                        forceFillCodeLocations( transUnit );
    344 
    345                         // Must happen before autogen routines are added.
    346                         PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls( transUnit ) );
    347 
    348                         // Must be after enum and pointer decay.
    349                         // Must be before compound literals.
    350                         PASS( "Generate Autogen Routines", Validate::autogenerateRoutines( transUnit ) );
    351340
    352341                        PASS( "Implement Mutex", Concurrency::implementMutex( transUnit ) );
     
    417406                        translationUnit = convert( move( transUnit ) );
    418407                } else {
    419                         PASS( "Validate-D", SymTab::validate_D( translationUnit ) );
    420408                        PASS( "Validate-E", SymTab::validate_E( translationUnit ) );
    421409                        PASS( "Validate-F", SymTab::validate_F( translationUnit ) );
  • tests/concurrent/mutexstmt/.expect/locks.txt

    rbbfe226 r70b4aeb9  
    33Start Test: multi lock deadlock/mutual exclusion
    44End Test: multi lock deadlock/mutual exclusion
    5 Start Test: single scoped lock mutual exclusion
    6 End Test: single scoped lock mutual exclusion
    7 Start Test: multi scoped lock deadlock/mutual exclusion
    8 End Test: multi scoped lock deadlock/mutual exclusion
  • tests/concurrent/mutexstmt/locks.cfa

    rbbfe226 r70b4aeb9  
    5959}
    6060
    61 thread T_Mutex_Scoped {};
    6261
    63 void main( T_Mutex_Scoped & this ) {
    64         for (unsigned int i = 0; i < num_times; i++) {
    65                 {
    66                         scoped_lock(single_acquisition_lock) s{m1};
    67                         count++;
    68                 }
    69                 {
    70                         scoped_lock(single_acquisition_lock) s{m1};
    71                         assert(!insideFlag);
    72                         insideFlag = true;
    73                         assert(insideFlag);
    74                         insideFlag = false;
    75                 }
    76         }
    77 }
    78 
    79 thread T_Multi_Scoped {};
    80 
    81 void main( T_Multi_Scoped & this ) {
    82         for (unsigned int i = 0; i < num_times; i++) {
    83                 {
    84                         scoped_lock(single_acquisition_lock) s{m1};
    85                         assert(!insideFlag);
    86                         insideFlag = true;
    87                         assert(insideFlag);
    88                         insideFlag = false;
    89                 }
    90                 {
    91                         scoped_lock(single_acquisition_lock) s1{m1};
    92                         scoped_lock(single_acquisition_lock) s2{m2};
    93                         scoped_lock(single_acquisition_lock) s3{m3};
    94                         scoped_lock(single_acquisition_lock) s4{m4};
    95                         scoped_lock(single_acquisition_lock) s5{m5};
    96                         assert(!insideFlag);
    97                         insideFlag = true;
    98                         assert(insideFlag);
    99                         insideFlag = false;
    100                 }
    101                 {
    102                         scoped_lock(single_acquisition_lock) s1{m1};
    103                         scoped_lock(single_acquisition_lock) s3{m3};
    104                         assert(!insideFlag);
    105                         insideFlag = true;
    106                         assert(insideFlag);
    107                         insideFlag = false;
    108                 }
    109                 {
    110                         scoped_lock(single_acquisition_lock) s1{m1};
    111                         scoped_lock(single_acquisition_lock) s2{m2};
    112                         scoped_lock(single_acquisition_lock) s4{m4};
    113                         assert(!insideFlag);
    114                         insideFlag = true;
    115                         assert(insideFlag);
    116                         insideFlag = false;
    117                 }
    118                 {
    119                         scoped_lock(single_acquisition_lock) s1{m1};
    120                         scoped_lock(single_acquisition_lock) s3{m3};
    121                         scoped_lock(single_acquisition_lock) s4{m4};
    122                         scoped_lock(single_acquisition_lock) s5{m5};
    123                         assert(!insideFlag);
    124                         insideFlag = true;
    125                         assert(insideFlag);
    126                         insideFlag = false;
    127                 }
    128         }
    129 }
    130 
    131 int num_tasks = 10;
    13262int main() {
    13363        processor p[10];
     
    13767                T_Mutex t[10];
    13868        }
    139         assert(count == num_tasks * num_times);
    14069        printf("End Test: single lock mutual exclusion\n");
    14170        printf("Start Test: multi lock deadlock/mutual exclusion\n");
     
    14473        }
    14574        printf("End Test: multi lock deadlock/mutual exclusion\n");
    146        
    147         count = 0;
    148         printf("Start Test: single scoped lock mutual exclusion\n");
    149         {
    150                 T_Mutex_Scoped t[10];
    151         }
    152         assert(count == num_tasks * num_times);
    153         printf("End Test: single scoped lock mutual exclusion\n");
    154         printf("Start Test: multi scoped lock deadlock/mutual exclusion\n");
    155         {
    156                 T_Multi_Scoped t[10];
    157         }
    158         printf("End Test: multi scoped lock deadlock/mutual exclusion\n");     
    15975}
Note: See TracChangeset for help on using the changeset viewer.