Ignore:
Timestamp:
Aug 9, 2014, 5:58:52 PM (5 years ago)
Author:
cameron
Message:

Eliminate INT2STRING in favor of std::to_string

Location:
icGREP/icgrep-devel/icgrep
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/cc_codegenobject.cpp

    r3850 r3984  
    5050    {
    5151        mGenSymCounter++;
    52         std::string sym = mGenSym_Template + INT2STRING(mGenSymCounter);
     52        std::string sym = mGenSym_Template + std::to_string(mGenSymCounter);
    5353        return add_assignment(sym, expr);
    5454    }
  • icGREP/icgrep-devel/icgrep/cc_codegenobject.h

    r3850 r3984  
    3333#include <map>
    3434
    35 #define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
    3635
    3736struct Expression{
  • icGREP/icgrep-devel/icgrep/cc_compiler.cpp

    r3955 r3984  
    417417std::string CC_Compiler::bit_var(int n)
    418418{
    419     return  mEncoding.getBasisPattern(0) + INT2STRING(n);
     419    return  mEncoding.getBasisPattern(0) + std::to_string(n);
    420420}
    421421
  • icGREP/icgrep-devel/icgrep/cc_compiler.h

    r3914 r3984  
    2525#include <stdlib.h>
    2626
    27 #define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
    2827
    2928class CC_Compiler
  • icGREP/icgrep-devel/icgrep/llvm_gen.cpp

    r3983 r3984  
    408408    for (int i = 0; i < mBits; i++)
    409409    {
    410         StoreBitBlockMarkerPtr(mBasis_Pattern + INT2STRING(i), i);
     410        StoreBitBlockMarkerPtr(mBasis_Pattern + std::to_string(i), i);
    411411    }
    412412
  • icGREP/icgrep-devel/icgrep/pablos_printer.cpp

    r3850 r3984  
    1616    //for (std::map<std::string, int>::iterator iter = cg_state.env->getEnv()->begin(); iter != cg_state.env->getEnv()->end(); ++iter)
    1717    //{
    18     //    strOut += "('" + iter->first + "'," + INT2STRING(iter->second) + "),";
     18    //    strOut += "('" + iter->first + "'," + std::to_string(iter->second) + "),";
    1919    //}
    2020    strOut = strOut.substr(0, strOut.length() - 1);
     
    3535{
    3636    list<PabloS*>::iterator it;
    37     //std::cout << "Total Statements: " + INT2STRING(stmts.size()) << std::endl;
     37    //std::cout << "Total Statements: " + std::to_string(stmts.size()) << std::endl;
    3838    for (it = stmts.begin(); it != stmts.end(); ++it)
    3939    {
     
    4949
    5050    list<PabloS*>::iterator it;
    51     std::cout << "Total Statements: " + INT2STRING(stmts.size()) << std::endl;
     51    std::cout << "Total Statements: " + std::to_string(stmts.size()) << std::endl;
    5252    for (it = stmts.begin(); it != stmts.end(); ++it)
    5353    {
     
    8080    if (All* all = dynamic_cast<All*>(expr))
    8181    {
    82         retVal = "All " + INT2STRING(all->getNum()) + " ";
     82        retVal = "All " + std::to_string(all->getNum()) + " ";
    8383    }
    8484    else if (Var* pablo_var = dynamic_cast<Var*>(expr))
  • icGREP/icgrep-devel/icgrep/pablos_printer.h

    r3850 r3984  
    4343#include <list>
    4444
    45 #define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
    4645
    4746class StatementPrinter
  • icGREP/icgrep-devel/icgrep/printer_pablos.cpp

    r3955 r3984  
    2929{
    3030    std::list<PabloS*>::iterator it;
    31     //std::cout << "Total Statements: " + INT2STRING(stmts.size()) << std::endl;
     31    //std::cout << "Total Statements: " + std::to_string(stmts.size()) << std::endl;
    3232    for (it = stmts.begin(); it != stmts.end(); ++it)
    3333    {
     
    4242    std::string strOut;
    4343
    44     std::cout << "Total Statements: " + INT2STRING(stmts.size()) << std::endl;
     44    std::cout << "Total Statements: " + std::to_string(stmts.size()) << std::endl;
    4545    std::list<PabloS*>::iterator it;
    4646    for (it = stmts.begin(); it != stmts.end(); ++it)
     
    7474    if (All* all = dynamic_cast<All*>(expr))
    7575    {
    76         retVal = "All " + INT2STRING(all->getNum()) + " ";
     76        retVal = "All " + std::to_string(all->getNum()) + " ";
    7777    }
    7878    else if (Call* pablo_call = dynamic_cast<Call*>(expr))
  • icGREP/icgrep-devel/icgrep/printer_pablos.h

    r3914 r3984  
    4343#include <list>
    4444
    45 #define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
    4645
    4746class StatementPrinter
  • icGREP/icgrep-devel/icgrep/printer_re.cpp

    r3914 r3984  
    3535        {
    3636            retVal += "[";
    37             retVal += INT2STRING(it->lo_codepoint) + ",";
    38             retVal += INT2STRING(it->hi_codepoint);
     37            retVal += std::to_string(it->lo_codepoint) + ",";
     38            retVal += std::to_string(it->hi_codepoint);
    3939            retVal += "]";
    4040        }
     
    5757        {
    5858            retVal += "[";
    59             retVal += INT2STRING(r_it->lo_codepoint) + ",";
    60             retVal += INT2STRING(r_it->hi_codepoint);
     59            retVal += std::to_string(r_it->lo_codepoint) + ",";
     60            retVal += std::to_string(r_it->hi_codepoint);
    6161            retVal += "]";
    6262        }
     
    7575    else if (Rep* re_rep = dynamic_cast<Rep*>(re))
    7676    {
    77         retVal += "Rep("  + PrintRE(re_rep->getRE()) + "," + INT2STRING(re_rep->getLB()) + ",";
    78         retVal += (re_rep->getUB() == unboundedRep ? "Unbounded" : "UpperBound(" + INT2STRING(re_rep->getUB()) + ")");
     77        retVal += "Rep("  + PrintRE(re_rep->getRE()) + "," + std::to_string(re_rep->getLB()) + ",";
     78        retVal += (re_rep->getUB() == unboundedRep ? "Unbounded" : "UpperBound(" + std::to_string(re_rep->getUB()) + ")");
    7979    }
    8080    else if (Seq* re_seq = dynamic_cast<Seq*>(re))
  • icGREP/icgrep-devel/icgrep/printer_re.h

    r3914 r3984  
    2323#include <list>
    2424
    25 #define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
    2625
    2726class Printer_RE
  • icGREP/icgrep-devel/icgrep/re_cc.cpp

    r3935 r3984  
    4747    for (it = mSparceCharSet.begin(); it != mSparceCharSet.end(); ++it)
    4848    {
    49         name += INT2STRING(it->lo_codepoint);
    50         name += INT2STRING(it->hi_codepoint);
     49        name += std::to_string(it->lo_codepoint);
     50        name += std::to_string(it->hi_codepoint);
    5151    }
    5252
     
    280280void CC::gensym_name()
    281281{
    282     mId = "lex.CC" + INT2STRING(msCSIidx);
     282    mId = "lex.CC" + std::to_string(msCSIidx);
    283283    msCSIidx++;
    284284}
  • icGREP/icgrep-devel/icgrep/re_cc.h

    r3935 r3984  
    1616#include <vector>
    1717
    18 #define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
    1918
    2019struct CharSetItem{
  • icGREP/icgrep-devel/icgrep/symbol_generator.cpp

    r3850 r3984  
    2020    {
    2121        //The insertion succeeded
    22         sym = prefix + INT2STRING(0);
     22        sym = prefix + std::to_string(0);
    2323        //std::cout << sym << " created" << std::endl;
    2424        return sym;
     
    3030        iter->second++;
    3131
    32         sym = prefix + INT2STRING(iter->second);
     32        sym = prefix + std::to_string(iter->second);
    3333        //std::cout << sym << " created" << std::endl;
    3434        return sym;
  • icGREP/icgrep-devel/icgrep/symbol_generator.h

    r3850 r3984  
    1414#include <map>
    1515
    16 #define INT2STRING(i) static_cast<std::ostringstream*>(&(std::ostringstream() << i))->str()
    1716
    1817class SymbolGenerator
Note: See TracChangeset for help on using the changeset viewer.