Changeset b3c36f4 for src/Common


Ignore:
Timestamp:
Jun 5, 2017, 11:43:18 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, resolv-new, with_gc
Children:
7e003011
Parents:
fa21ac9
Message:

Added some attribute((unused)) where appropriate

Location:
src/Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/Assert.cc

    rfa21ac9 rb3c36f4  
    2121extern const char * __progname;                                                 // global name of running executable (argv[0])
    2222
    23 #define CFA_ASSERT_FMT "*CFA assertion error* from program \"%s\" in \"%s\" at line %d in file \"%s\""
     23#define CFA_ASSERT_FMT "*CFA assertion error* \"%s\" from program \"%s\" in \"%s\" at line %d in file \"%s\""
    2424
    2525// called by macro assert in assert.h
    2626void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) {
    27         fprintf( stderr, CFA_ASSERT_FMT ".\n", __progname, function, line, file );
     27        fprintf( stderr, CFA_ASSERT_FMT ".\n", assertion, __progname, function, line, file );
    2828        abort();
    2929}
     
    3131// called by macro assertf
    3232void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) {
    33         fprintf( stderr, CFA_ASSERT_FMT ": ", __progname, function, line, file );
     33        fprintf( stderr, CFA_ASSERT_FMT ": ", assertion, __progname, function, line, file );
    3434        va_list args;
    3535        va_start( args, fmt );
  • src/Common/PassVisitor.proto.h

    rfa21ac9 rb3c36f4  
    2323
    2424template<typename pass_type, typename node_type>
    25 static inline void previsit_impl( __attribute__((unused)) pass_type& pass, node_type * node, __attribute__((unused)) long unused ) {}
     25static inline void previsit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) node_type * node, __attribute__((unused)) long unused ) {}
    2626
    2727
     
    3232
    3333template<typename pass_type, typename node_type>
    34 static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, node_type * node, __attribute__((unused)) long unused ) {}
     34static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) node_type * node, __attribute__((unused)) long unused ) {}
    3535
    3636// Mutate
     
    4141
    4242template<typename pass_type, typename node_type>
    43 static inline void premutate_impl( __attribute__((unused)) pass_type& pass, node_type * node, __attribute__((unused)) long unused ) {}
     43static inline void premutate_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) node_type * node, __attribute__((unused)) long unused ) {}
    4444
    4545
     
    7171
    7272// Fields
    73 #define FIELD_PTR( type, name )                                                                                                                  \
    74 template<typename pass_type>                                                                                                                     \
    75 static inline auto name##_impl( pass_type& pass, __attribute__((unused)) int unused ) ->decltype( &pass.name ) { return &pass.name; }          \
    76                                                                                                                                                  \
    77 template<typename pass_type>                                                                                                                     \
     73#define FIELD_PTR( type, name )                                                                                                        \
     74template<typename pass_type>                                                                                                           \
     75static inline auto name##_impl( pass_type& pass, __attribute__((unused)) int unused ) ->decltype( &pass.name ) { return &pass.name; }  \
     76                                                                                                                                       \
     77template<typename pass_type>                                                                                                           \
    7878static inline type * name##_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) long unused ) { return nullptr;}    \
    7979
Note: See TracChangeset for help on using the changeset viewer.