Changeset 05e6eb5 for src


Ignore:
Timestamp:
Jul 30, 2018, 4:43:48 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
5cbacf1
Parents:
fd2debf
git-author:
Rob Schluntz <rschlunt@…> (07/30/18 15:38:10)
git-committer:
Rob Schluntz <rschlunt@…> (07/30/18 16:43:48)
Message:

Warn about constructor/destructor priorities 101-200 only when not building the library

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/CompilationState.cc

    rfd2debf r05e6eb5  
    3939        linemarks = false;
    4040
    41 // bootstrapping:
    42 //   libcfap || treep
    43 
    4441// Local Variables: //
    4542// tab-width: 4 //
  • src/CompilationState.h

    rfd2debf r05e6eb5  
    4040        linemarks;
    4141
    42 
     42// is the compiler building prelude or libcfa?
     43inline bool buildingLibrary() {
     44        return libcfap | treep;
     45}
    4346
    4447// Local Variables: //
  • src/Validate/HandleAttributes.cc

    rfd2debf r05e6eb5  
    117117                                std::string name = attr->normalizedName();
    118118                                if (name == "init_priority") {
    119 
     119                                        // TODO: implement C++-like init_priority attribute
    120120                                }
    121121                        }
     
    139139                                                        SemanticWarning(attr->location, Warning::GccAttributes,
    140140                                                                toCString( name, " priorities from 0 to 100 are reserved for the implementation" ) );
    141                                                 } else if (priority < 201) {
     141                                                } else if (priority < 201 && ! buildingLibrary()) {
    142142                                                        SemanticWarning(attr->location, Warning::GccAttributes,
    143143                                                                toCString( name, " priorities from 101 to 200 are reserved for the implementation" ) );
  • src/main.cc

    rfd2debf r05e6eb5  
    183183
    184184                        // Read to gcc builtins, if not generating the cfa library
    185                         FILE * gcc_builtins = fopen( libcfap | treep ? "../prelude/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" );
     185                        FILE * gcc_builtins = fopen( buildingLibrary() ? "../prelude/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" );
    186186                        assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" );
    187187                        parse( gcc_builtins, LinkageSpec::Compiler );
    188188
    189189                        // read the extra prelude in, if not generating the cfa library
    190                         FILE * extras = fopen( libcfap | treep ? "../prelude/extras.cf" : CFA_LIBDIR "/extras.cf", "r" );
     190                        FILE * extras = fopen( buildingLibrary() ? "../prelude/extras.cf" : CFA_LIBDIR "/extras.cf", "r" );
    191191                        assertf( extras, "cannot open extras.cf\n" );
    192192                        parse( extras, LinkageSpec::BuiltinC );
     
    194194                        if ( ! libcfap ) {
    195195                                // read the prelude in, if not generating the cfa library
    196                                 FILE * prelude = fopen( treep ? "../prelude/prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );
     196                                FILE * prelude = fopen( buildingLibrary() ? "../prelude/prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );
    197197                                assertf( prelude, "cannot open prelude.cf\n" );
    198198                                parse( prelude, LinkageSpec::Intrinsic );
    199199
    200200                                // Read to cfa builtins, if not generating the cfa library
    201                                 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );
     201                                FILE * builtins = fopen( buildingLibrary() ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );
    202202                                assertf( builtins, "cannot open builtins.cf\n" );
    203203                                parse( builtins, LinkageSpec::BuiltinCFA );
     
    274274
    275275                // fix ObjectDecl - replaces ConstructorInit nodes
    276                 PASS( "fixInit", InitTweak::fix( translationUnit, libcfap || treep ) );
     276                PASS( "fixInit", InitTweak::fix( translationUnit, buildingLibrary() ) );
    277277                if ( ctorinitp ) {
    278278                        dump ( translationUnit );
Note: See TracChangeset for help on using the changeset viewer.