Changeset 6943a987 for src/Common


Ignore:
Timestamp:
Aug 29, 2016, 10:33:05 AM (10 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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, stuck-waitfor-destruct, with_gc
Children:
5e644d3e
Parents:
79841be (diff), 413ad05 (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

Location:
src/Common
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/CompilerError.h

    r79841be r6943a987  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 07:20:37 2015
    13 // Update Count     : 2
     12// Last Modified On : Thu Aug 18 23:41:30 2016
     13// Update Count     : 3
    1414//
    1515
     
    1818
    1919#include <string>
    20 //#include "../config.h"
    2120
    2221class CompilerError : public std::exception {
  • src/Common/module.mk

    r79841be r6943a987  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jun  1 17:51:23 2015
    14 ## Update Count     : 1
     13## Last Modified On : Thu Aug 18 13:29:04 2016
     14## Update Count     : 2
    1515###############################################################################
    1616
    1717SRC += Common/SemanticError.cc \
    18        Common/UniqueName.cc
     18       Common/UniqueName.cc \
     19       Common/Assert.cc
  • src/Common/utility.h

    r79841be r6943a987  
    4949}
    5050
     51template< typename T, typename U >
     52static inline T * maybeMoveBuild( const U *orig ) {
     53        T* ret = maybeBuild<T>(orig);
     54        delete orig;
     55        return ret;
     56}
     57
    5158template< typename Input_iterator >
    5259void printEnums( Input_iterator begin, Input_iterator end, const char * const *name_array, std::ostream &os ) {
     
    137144
    138145template < typename T >
    139 std::string toString ( T value ) {
     146void toString_single ( std::ostream & os, const T & value ) {
     147        os << value;
     148}
     149
     150template < typename T, typename... Params >
     151void toString_single ( std::ostream & os, const T & value, const Params & ... params ) {
     152        os << value;
     153        toString_single( os, params ... );
     154}
     155
     156template < typename ... Params >
     157std::string toString ( const Params & ... params ) {
    140158        std::ostringstream os;
    141         os << value; // << std::ends;
     159        toString_single( os, params... );
    142160        return os.str();
    143161}
     
    211229}
    212230
     231template< typename T >
     232void warn_single( const T & arg ) {
     233        std::cerr << arg << std::endl;
     234}
     235
     236template< typename T, typename... Params >
     237void warn_single(const T & arg, const Params & ... params ) {
     238        std::cerr << arg;
     239        warn_single( params... );
     240}
     241
     242template< typename... Params >
     243void warn( const Params & ... params ) {
     244        std::cerr << "Warning: ";
     245        warn_single( params... );
     246}
     247
    213248#endif // _UTILITY_H
    214249
Note: See TracChangeset for help on using the changeset viewer.