Changeset af39199d for src


Ignore:
Timestamp:
May 3, 2018, 12:23:14 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
01b8ccf1
Parents:
7ca8441c
Message:

add and use search routine

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.cc

    r7ca8441c raf39199d  
    77// SemanticError.cc --
    88//
    9 // Author           : Richard C. Bilson
     9// Author           : Thierry Delisle
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug 29 18:17:35 2017
    13 // Update Count     : 3
     12// Last Modified On : Wed May  2 18:13:37 2018
     13// Update Count     : 8
    1414//
    1515
     
    5959void SemanticWarning_Set(const char * const name, Severity s) {
    6060        size_t idx = 0;
    61         for ( auto & w : WarningFormats ) {
     61        for ( const auto & w : WarningFormats ) {
    6262                if ( std::strcmp( name, w.name ) == 0 ) {
    6363                        get_severities()[idx] = s;
  • src/Common/SemanticError.h

    r7ca8441c raf39199d  
    77// SemanticError.h --
    88//
    9 // Author           : Richard C. Bilson
     9// Author           : Thierry Delisle
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May  2 15:00:01 2018
    13 // Update Count     : 23
     12// Last Modified On : Wed May  2 18:13:15 2018
     13// Update Count     : 29
    1414//
    1515
     
    1717
    1818#include "ErrorObjects.h"
     19#include <cstring>
    1920
    2021//-----------------------------------------------------------------------------
     
    7677void SemanticWarning_Set           (const char * const name, Severity s);
    7778
     79// SKULLDUGGERY: cfa.cc is built before SemanticError.cc but needs this routine.
     80static inline bool SemanticWarning_Exist(const char * const name) {
     81        for ( const auto & w : WarningFormats ) {
     82                if ( std::strcmp( name, w.name ) == 0 ) return true;
     83        }
     84        return false;
     85}
     86
    7887//-----------------------------------------------------------------------------
    7988// Helpers
  • src/driver/cfa.cc

    r7ca8441c raf39199d  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May  2 14:32:08 2018
    13 // Update Count     : 222
     12// Last Modified On : Wed May  2 17:57:43 2018
     13// Update Count     : 224
    1414//
    1515
     
    176176                                        unsigned int adv = prefix( arg, "-Wno-" ) ? 5 : 2;
    177177                                        args[nargs] = argv[i];                          // conditionally pass the argument along
    178                                         char * warning = argv[i] + adv;         // extract warning
    179                                         for ( const auto w : WarningFormats ) {
    180                                                 if ( strcmp( warning, w.name ) == 0 ) { // replace the argument for cfa-cpp
    181                                                         args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + arg ) ).c_str();
    182                                                         break;
    183                                                 } // if
    184                                         } // for
     178                                        const char * warning = argv[i] + adv;     // extract warning
     179                                        if ( SemanticWarning_Exist( warning ) ) { // replace the argument for cfa-cpp
     180                                                args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + arg ) ).c_str();
     181                                        } // if
    185182                                        nargs += 1;
    186183                                } // if
Note: See TracChangeset for help on using the changeset viewer.