Changeset 30763fd for driver/cc1.cc


Ignore:
Timestamp:
Nov 26, 2019, 3:20:30 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d4f1521
Parents:
7768b8d (diff), 58e280f (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' into relaxed_ready

File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cc1.cc

    r7768b8d r30763fd  
    335335        #endif // __DEBUG_H__
    336336
     337        enum {
     338                Color_Auto   = 0,
     339                Color_Always = 1,
     340                Color_Never  = 2,
     341        } color_arg = Color_Auto;
     342
     343        const char * color_names[3] = { "--colors=auto", "--colors=always", "--colors=never" };
     344
    337345        // process all the arguments
    338346
     
    341349                if ( prefix( arg, "-" ) ) {
    342350                        // strip inappropriate flags
     351
     352                        if ( prefix( arg, "-fdiagnostics-color=" ) ) {
     353                                string choice = arg.substr(20);
     354                                     if(choice == "always") color_arg = Color_Always;
     355                                else if(choice == "never" ) color_arg = Color_Never;
     356                                else if(choice == "auto"  ) color_arg = Color_Auto;
     357                        } else if ( arg == "-fno-diagnostics-color" ) {
     358                                color_arg = Color_Auto;
     359                        }
    343360
    344361                        if ( arg == "-quiet" || arg == "-version" || arg == "-fpreprocessed" ||
     
    440457                        cargs[ncargs++] = cfa_cpp_out.c_str();
    441458                } // if
     459
     460                cargs[ncargs++] = color_names[color_arg];
     461
    442462                cargs[ncargs] = nullptr;                                                // terminate argument list
    443463
Note: See TracChangeset for help on using the changeset viewer.