Changeset 5af7306


Ignore:
Timestamp:
Apr 23, 2018, 4:46:43 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
2efe4b8
Parents:
fb97252f
Message:

Assorted bug fixes

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Common/GC.cc

    rfb97252f r5af7306  
    5757//     set variable GC_TRAP_OBJ = <target>
    5858//     disable <first breakpoint>
     59//     continue
    5960#ifdef GC_TRAP
    6061#include <csignal>
  • src/InitTweak/GenInit.cc

    rfb97252f r5af7306  
    258258                                        // generic parameters should not play a role in determining whether a generic type is constructed - construct all generic types, so that
    259259                                        // polymorphic constructors make generic types managed types
    260                                         StructInstType inst( Type::Qualifiers(), aggregateDecl );
    261                                         managedTypes.insert( SymTab::Mangler::mangleConcrete( &inst ) );
     260                                        auto inst = new StructInstType( Type::Qualifiers(), aggregateDecl );
     261                                        managedTypes.insert( SymTab::Mangler::mangleConcrete( inst ) );
    262262                                        break;
    263263                                }
  • src/ResolvExpr/AlternativeFinder.cc

    rfb97252f r5af7306  
    10821082                AlternativeFinder funcOpFinder( indexer, env );
    10831083                // it's ok if there aren't any defined function ops
    1084                 funcOpFinder.maybeFind( opExpr);
     1084                funcOpFinder.maybeFind( opExpr );
    10851085                PRINT(
    10861086                        std::cerr << "known function ops:" << std::endl;
  • src/ResolvExpr/ConversionCost.cc

    rfb97252f r5af7306  
    2020#include <string>                        // for operator==, string
    2121
     22#include "Common/GC.h"                   // for new_static_root
    2223#include "ResolvExpr/Cost.h"             // for Cost
    2324#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
     
    353354        void ConversionCost::postvisit( EnumInstType * ) {
    354355                static Type::Qualifiers q;
    355                 static BasicType integer( q, BasicType::SignedInt );
    356                 cost = costFunc( &integer, dest, indexer, env );  // safe if dest >= int
     356                static BasicType* integer = new_static_root<BasicType>( q, BasicType::SignedInt );
     357                cost = costFunc( integer, dest, indexer, env );  // safe if dest >= int
    357358                if ( cost < Cost::unsafe ) {
    358359                        cost.incSafe();
  • src/SymTab/Validate.cc

    rfb97252f r5af7306  
    4848#include "CodeGen/CodeGenerator.h"     // for genName
    4949#include "CodeGen/OperatorTable.h"     // for isCtorDtor, isCtorDtorAssign
     50#include "Common/GC.h"                 // for new_static_root, register_static_root
    5051#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
    5152#include "Common/ScopedMap.h"          // for ScopedMap
     
    673674                        // grab and remember declaration of size_t
    674675                        SizeType = eliminator.pass.typedefNames["size_t"].first->get_base()->clone();
     676                        GC::get().register_static_root( SizeType );
    675677                } else {
    676678                        // xxx - missing global typedef for size_t - default to long unsigned int, even though that may be wrong
    677679                        // eventually should have a warning for this case.
    678                         SizeType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt );
     680                        SizeType =
     681                                new_static_root<BasicType>( Type::Qualifiers(), BasicType::LongUnsignedInt );
    679682                }
    680683                filter( translationUnit, isTypedef );
  • src/SynTree/GcTracer.h

    rfb97252f r5af7306  
    5353        }
    5454
     55        void postvisit( DeclarationWithType* decl ) {
     56                maybeAccept( decl->asmName, *visitor );
     57        }
     58
     59private:
     60        void visit( InferredParams& inferParams ) {
     61                for ( auto& entry : inferParams ) {
     62                        maybeAccept( entry.second.actualType, *visitor );
     63                        maybeAccept( entry.second.formalType, *visitor );
     64                        maybeAccept( entry.second.expr, *visitor );
     65                        visit( *entry.second.inferParams );
     66                }
     67        }
     68
     69public:
    5570        void postvisit( Expression* expr ) {
    5671                maybeAccept( expr->env, *visitor );
     72                visit( expr->inferParams );
    5773        }
    5874
Note: See TracChangeset for help on using the changeset viewer.