Changeset b110bcc for driver/cfa.cc


Ignore:
Timestamp:
Apr 21, 2023, 5:36:12 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, master
Children:
28f8f15, 6e4c44d
Parents:
2ed94a9 (diff), 699a97d (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cfa.cc

    r2ed94a9 rb110bcc  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 14 21:55:12 2021
    13 // Update Count     : 467
     12// Last Modified On : Mon Apr 10 21:16:00 2023
     13// Update Count     : 476
    1414//
    1515
     
    4444        static int flags = 0;
    4545
     46    // This allocation 'leaks' memory from the program to the execution
     47    // environment, as putenv does not manage the storage of the string used
     48    // as an environment variable. This leak is necessary to ensure the
     49    // underlying C string is allocated long enough.
    4650        if ( putenv( (char *)( *new string( string( __CFA_FLAGPREFIX__ + to_string( flags++ ) + "__=" ) + arg ) ).c_str() ) ) {
    4751                cerr << argv[0] << " error, cannot set environment variable." << endl;
     
    198202                                } // if
    199203                        } else if ( arg == "-CFA" ) {
    200                                 CFA_flag = true;                                                // strip the -CFA flag
     204                                CFA_flag = true;                                                // strip -CFA flag
    201205                                link = false;
    202206                                args[nargs++] = "-fsyntax-only";                // stop after stage 2
    203207                        } else if ( arg == "-debug" ) {
    204                                 debug = true;                                                   // strip the debug flag
     208                                debug = true;                                                   // strip debug flag
    205209                        } else if ( arg == "-nodebug" ) {
    206                                 debug = false;                                                  // strip the nodebug flag
     210                                debug = false;                                                  // strip nodebug flag
    207211                        } else if ( arg == "-quiet" ) {
    208                                 quiet = true;                                                   // strip the quiet flag
     212                                quiet = true;                                                   // strip quiet flag
    209213                        } else if ( arg == "-noquiet" ) {
    210                                 quiet = false;                                                  // strip the noquiet flag
     214                                quiet = false;                                                  // strip noquiet flag
     215                        } else if ( arg == "-invariant" ) {
     216                                Putenv( argv, "-" + arg );
     217                        } else if ( arg == "--invariant" ) {
     218                                Putenv( argv, arg );
    211219                        } else if ( arg == "-no-include-stdhdr" ) {
    212                                 noincstd_flag = true;                                   // strip the no-include-stdhdr flag
     220                                noincstd_flag = true;                                   // strip no-include-stdhdr flag
    213221                        } else if ( arg == "-nolib" ) {
    214                                 nolib = true;                                                   // strip the nolib flag
     222                                nolib = true;                                                   // strip nolib flag
    215223                        } else if ( arg == "-help" ) {
    216                                 help = true;                                                    // strip the help flag
     224                                help = true;                                                    // strip help flag
    217225                        } else if ( arg == "-nohelp" ) {
    218                                 help = false;                                                   // strip the nohelp flag
     226                                help = false;                                                   // strip nohelp flag
    219227                        } else if ( arg == "-cfalib") {
    220228                                compiling_libs = true;
     
    274282                                } // if
    275283                        } else if ( prefix( arg, "-B" ) ) {
    276                                 bprefix = arg.substr(2);                                // strip the -B flag
     284                                bprefix = arg.substr(2);                                // strip -B flag
    277285                        } else if ( arg == "-c" || arg == "-S" || arg == "-E" || arg == "-M" || arg == "-MM" ) {
    278286                                args[nargs++] = argv[i];                                // pass flag along
     
    444452
    445453        args[nargs++] = "-fexceptions";                                         // add exception flags (unconditionally)
     454        args[nargs++] = "-D_GNU_SOURCE";                                        // force gnu libraries
    446455
    447456        // add flags based on the type of compile
Note: See TracChangeset for help on using the changeset viewer.