Changeset 817 in dev


Ignore:
Timestamp:
Mar 19, 2011, 10:47:28 PM (13 years ago)
Author:
イグトランス (egtra)
Message:

compilerにおいて、各クラスのコピー禁止を明確化、ならびにコピー可能なものにムーブコンストラクタ・ムーブ代入演算子を追加。

Location:
branches/egtra/ab5.0/abdev
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/NonVolatile.h

    r523 r817  
    3939    void load();
    4040    void save();
     41
     42private:
     43    CNonVolatile(CNonVolatile const&);
     44    CNonVolatile& operator =(CNonVolatile const&);
    4145};
    4246extern CNonVolatile *pobj_nv;
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/BreakPoint.h

    r743 r817  
    99    BreakPointsPerFile(const char *lpszFileName,int iLineNum);
    1010
     11    BreakPointsPerFile(BreakPointsPerFile&& y)
     12        : filename(std::move(y.filename))
     13        , lines(std::move(y.lines))
     14    {
     15    }
     16
     17    BreakPointsPerFile(BreakPointsPerFile const& y)
     18        : filename(y.filename)
     19        , lines(y.lines)
     20    {
     21    }
     22
     23    BreakPointsPerFile& operator =(BreakPointsPerFile&& y)
     24    {
     25        filename = std::move(y.filename);
     26        lines = std::move(y.lines);
     27        return *this;
     28    }
     29
     30    BreakPointsPerFile& operator =(BreakPointsPerFile const& y)
     31    {
     32        return *this = std::move(BreakPointsPerFile(y));
     33    }
     34
    1135    void add(int iLineNum);
    1236    void remove(int iLineNum);
    1337
    1438    void update( char *nativeCodeBuffer, const SourceLines &sourceLines );
     39
    1540};
    1641typedef std::vector<BreakPointsPerFile> BreakPointsPerFiles;
     
    2752
    2853    char *update( char *nativeCodeBuffer, int SizeOf_CodeSection, const SourceLines &sourceLines );
     54
     55private:
     56    BreakPointManager(BreakPointManager const&);
     57    BreakPointManager& operator =(BreakPointManager const&);
    2958};
    3059
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/CodeGenerator.h

    r641 r817  
    3333        return typeSize;
    3434    }
     35
     36private:
     37    PertialSchedule(PertialSchedule const&);
     38    PertialSchedule& operator =(PertialSchedule const&);
    3539};
    3640typedef std::vector<const PertialSchedule *> PertialSchedules;
     
    6872        return sourceCodePos;
    6973    }
     74
     75private:
     76    GotoLabelSchedule(GotoLabelSchedule const&);
     77    GotoLabelSchedule& operator =(GotoLabelSchedule const&);
    7078};
    7179typedef std::vector<const GotoLabelSchedule *> GotoLabelSchedules;
     
    9098        , address( nativeCodePos )
    9199    {
     100    }
     101
     102    GotoLabel(GotoLabel&& y)
     103        : name(std::move(y.name))
     104        , line(std::move(y.line))
     105        , address(std::move(y.address))
     106    {
     107    }
     108
     109    GotoLabel(GotoLabel const& y)
     110        : name(y.name)
     111        , line(y.line)
     112        , address(y.address)
     113    {
     114    }
     115
     116    GotoLabel& operator =(GotoLabel&& y)
     117    {
     118        name = std::move(y.name);
     119        line = std::move(y.line);
     120        address = std::move(y.address);
     121        return *this;
     122    }
     123
     124    GotoLabel& operator =(GotoLabel const& y)
     125    {
     126        return *this = std::move(GotoLabel(y));
    92127    }
    93128};
     
    147182    void Break();
    148183    void RunScheduleOfBreak();
     184
     185private:
     186    LexicalScope(LexicalScope const&);
     187    LexicalScope& operator =(LexicalScope const&);
    149188};
    150189
     
    184223    //Returnステートメント用のデストラクタ呼び出し
    185224    void CallDestructorsOfReturn( int BaseLevel = 0 );
     225
     226private:
     227    LexicalScopes(LexicalScopes const&);
     228    LexicalScopes& operator =(LexicalScopes const&);
    186229};
    187230
     
    534577        pNativeCode->Put( c6 );
    535578    }
     579
     580private:
     581    CodeGenerator(CodeGenerator const&);
     582    CodeGenerator& operator =(CodeGenerator const&);
    536583};
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r812 r817  
    215215    bool IsCompilingClass();
    216216    const CClass &GetCompilingClass();
     217
     218private:
     219    Compiler(Compiler const&);
     220    Compiler& operator =(Compiler const&);
    217221};
    218222
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/Configuration.h

    r477 r817  
    2727        ar & BOOST_SERIALIZATION_NVP( abdevRootRelativePath );
    2828    }
     29
     30    Configuration(Configuration const&);
     31    Configuration& operator =(Configuration const&);
    2932};
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/DataTableGenerator.h

    r589 r817  
    1717    }
    1818
     19private:
     20    DataTableGenerator();
     21    DataTableGenerator(DataTableGenerator const&);
     22    DataTableGenerator& operator =(DataTableGenerator const&);
    1923};
    2024
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/Debugger.h

    r467 r817  
    2424        return isRunning;
    2525    }
     26
     27private:
     28    Debugger(Debugger const&);
     29    Debugger& operator =(Debugger const&);
    2630};
    2731
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/Enum.h

    r750 r817  
    66    std::string value;
    77    int sourceIndex;
     8
    89public:
    910    EnumMember( const std::string &name, const std::string &value, int sourceIndex )
     
    1314    {
    1415    }
     16
     17    EnumMember(EnumMember&& y)
     18        : name(std::move(y.name))
     19        , value(std::move(y.value))
     20        , sourceIndex(std::move(y.sourceIndex))
     21    {
     22    }
     23
     24    EnumMember(EnumMember const& y)
     25        : name(y.name)
     26        , value(y.value)
     27        , sourceIndex(y.sourceIndex)
     28    {
     29    }
     30
     31    EnumMember& operator =(EnumMember&& y)
     32    {
     33        name = std::move(y.name);
     34        value = std::move(y.value);
     35        sourceIndex = std::move(y.sourceIndex);
     36        return *this;
     37    }
     38
     39    EnumMember& operator =(EnumMember const& y)
     40    {
     41        return *this = std::move(EnumMember(y));
     42    }
     43
    1544    const std::string &GetName() const
    1645    {
     
    3968        : Symbol( namespaceScopes, name )
    4069    {
     70    }
     71
     72    EnumInfo(EnumInfo&& y)
     73        : Symbol(std::move(y))
     74        , bConst(std::move(y.bConst))
     75        , members(std::move(y.members))
     76    {
     77    }
     78
     79    EnumInfo(EnumInfo const& y)
     80        : Symbol(y)
     81        , bConst(y.bConst)
     82        , members(y.members)
     83    {
     84    }
     85
     86    EnumInfo& operator =(EnumInfo&& y)
     87    {
     88        Symbol::operator =(std::move(y));
     89        bConst = std::move(y.bConst);
     90        members = std::move(y.members);
     91        return *this;
     92    }
     93
     94    EnumInfo& operator =(EnumInfo const& y)
     95    {
     96        return *this = std::move(EnumInfo(y));
    4197    }
    4298
     
    80136        return NULL;
    81137    };
     138
     139    EnumInfoCollection() {}
     140
     141private:
     142    EnumInfoCollection(EnumInfoCollection const&);
     143    EnumInfoCollection& operator =(EnumInfoCollection const&);
    82144};
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/Linker.h

    r357 r817  
    5454    // データテーブルをセット
    5555    void SetDataTable( DataTable &dataTable );
     56
     57private:
     58    Linker(Linker const&);
     59    Linker& operator =(Linker const&);
    5660};
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h

    r812 r817  
    2424    {
    2525    }
     26
    2627    ErrorInfo( int errorCode, const std::string &keyword, int sourceIndex );
     28
     29    ErrorInfo(ErrorInfo&& y)
     30        : errorCode(std::move(y.errorCode))
     31        , keyword(std::move(y.keyword))
     32        , sourceFilePath(std::move(y.sourceFilePath))
     33        , sourceLineNum(std::move(y.sourceLineNum))
     34        , errorLineNum(std::move(y.errorLineNum))
     35    {
     36    }
     37
     38    ErrorInfo(ErrorInfo const& y)
     39        : errorCode(y.errorCode)
     40        , keyword(y.keyword)
     41        , sourceFilePath(y.sourceFilePath)
     42        , sourceLineNum(y.sourceLineNum)
     43        , errorLineNum(y.errorLineNum)
     44    {
     45    }
     46
     47    ErrorInfo& operator =(ErrorInfo&& y)
     48    {
     49        errorCode = std::move(y.errorCode);
     50        keyword = std::move(y.keyword);
     51        sourceFilePath = std::move(y.sourceFilePath);
     52        sourceLineNum = std::move(y.sourceLineNum);
     53        errorLineNum = std::move(y.errorLineNum);
     54        return *this;
     55    }
     56
     57    ErrorInfo& operator =(ErrorInfo const& y)
     58    {
     59        return *this = std::move(ErrorInfo(y));
     60    }
    2761
    2862    int GetErrorCode() const
     
    6397
    6498public:
     99    ErrorMessenger() {}
     100
    65101    void Output( const ErrorInfo &errorInfo );
    66102    void Output( int errorCode, const std::string &keyword, int sourceIndex = -1 );
     
    75111
    76112    void ShowErrorLine( int errorLineNum );
     113
     114private:
     115    ErrorMessenger(ErrorMessenger const&);
     116    ErrorMessenger& operator =(ErrorMessenger const&);
    77117};
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/Program.h

    r719 r817  
    9696
    9797    int GetExitCode() const;
     98
     99private:
     100    Program(Program const&);
     101    Program& operator =(Program const&);
    98102};
    99103
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/logger.h

    r523 r817  
    2828        ar & BOOST_SERIALIZATION_NVP( stopStep );
    2929    }
     30
     31    LoggerSetting(LoggerSetting const&);
     32    LoggerSetting operator =(LoggerSetting const&);
    3033};
    3134
  • branches/egtra/ab5.0/abdev/compiler_x64/Opcode.h

    r704 r817  
    11#pragma once
     2
     3#include <array>
    24
    35#include "MachineFixed.h"
     
    3739        , sourceCodePos( sourceCodePos )
    3840    {
     41    }
     42
     43    WithInfo(WithInfo&& y)
     44        : name(std::move(y.name))
     45        , sourceCodePos(std::move(y.sourceCodePos))
     46    {
     47    }
     48
     49    WithInfo(WithInfo const& y)
     50        : name(y.name)
     51        , sourceCodePos(y.sourceCodePos)
     52    {
     53    }
     54
     55    WithInfo& operator =(WithInfo&& y)
     56    {
     57        name = std::move(y.name);
     58        sourceCodePos = std::move(y.sourceCodePos);
     59        return *this;
     60    }
     61
     62    WithInfo& operator =(WithInfo const& y)
     63    {
     64        return *this = std::move(WithInfo(y));
    3965    }
    4066};
     
    75101
    76102    void error_check(void);
     103
     104private:
     105    StackFrame(StackFrame const&);
     106    StackFrame& operator =(StackFrame const&);
    77107};
    78108extern StackFrame *pobj_sf;
     
    93123    void backup();
    94124    void restore();
     125
     126private:
     127    CBlockReg(CBlockReg const&);
     128    CBlockReg& operator =(CBlockReg const&);
    95129};
    96130extern CBlockReg *pobj_BlockReg;
     
    101135
    102136    //利用可能なレジスタを列挙する関数
    103     void EnumRegister(int *pRegList,int nMaxList,int *array_reg,int *sp,int AnswerReg);
    104 
    105     int array_UseReg[16],sp_UseReg;
    106 
    107     int array_XmmReg[16];
     137    void EnumRegister(int const *pRegList,int nMaxList,int *array_reg,int *sp,int AnswerReg);
     138
     139    std::array<int, 16> array_UseReg;
     140    int sp_UseReg;
     141
     142    std::array<int, 16> array_XmmReg;
    108143    int sp_XmmReg;
    109144
     
    113148    CRegister(){};
    114149    CRegister(int AnswerReg);
     150   
     151    CRegister(CRegister const& y)
     152        : array_UseReg(y.array_UseReg)
     153        , sp_UseReg(y.sp_UseReg)
     154        , array_XmmReg(y.array_XmmReg)
     155        , sp_XmmReg(y.sp_XmmReg)
     156        , init_sp_reg(y.init_sp_reg)
     157        , init_sp_xmm_reg(y.init_sp_xmm_reg)
     158    {
     159    }
     160
     161    CRegister& operator =(CRegister const& y)
     162    {
     163        array_UseReg = y.array_UseReg;
     164        sp_UseReg = y.sp_UseReg;
     165        array_XmmReg = y.array_XmmReg;
     166        sp_XmmReg = y.sp_XmmReg;
     167        init_sp_reg = y.init_sp_reg;
     168        init_sp_xmm_reg = y.init_sp_xmm_reg;
     169        return *this;
     170    }
     171
    115172    ~CRegister(){};
    116173
     
    313370    void BackupParameter(int pi_num);
    314371    void RestoreParameter(int pi_num);
     372
     373private:
     374    ParamImpl(ParamImpl const&);
     375    ParamImpl& operator =(ParamImpl const&);
    315376};
    316377
     
    325386    void lock(int level);
    326387    void unlock(int level);
     388
     389private:
     390    CDBLockParms(CDBLockParms const&);
     391    CDBLockParms& operator =(CDBLockParms const&);
    327392};
    328393
  • branches/egtra/ab5.0/abdev/compiler_x64/Register.cpp

    r468 r817  
    112112CRegister *pobj_reg;
    113113
    114 void CRegister::EnumRegister(int *pRegList,int nMaxList,int *array_reg,int *sp,int AnswerReg){
     114void CRegister::EnumRegister(int const* pRegList,int nMaxList,int *array_reg,int *sp,int AnswerReg){
    115115    int i,i2,sw=0;
    116116
     
    161161
    162162    EnumRegister(
    163         (int *)CalculationRegister,
     163        CalculationRegister,
    164164        sizeof(CalculationRegister)/sizeof(int),
    165         array_UseReg,
     165        array_UseReg.data(),
    166166        &sp_UseReg,
    167167        AnswerReg);
     
    174174
    175175    EnumRegister(
    176         (int *)CalculationXmmRegister,
     176        CalculationXmmRegister,
    177177        sizeof(CalculationXmmRegister)/sizeof(int),
    178         array_XmmReg,
     178        array_XmmReg.data(),
    179179        &sp_XmmReg,
    180180        AnswerReg);
  • branches/egtra/ab5.0/abdev/compiler_x86/Opcode.h

    r702 r817  
    3737        , sourceCodePos( sourceCodePos )
    3838    {
     39    }
     40
     41    WithInfo(WithInfo&& y)
     42        : name(std::move(y.name))
     43        , sourceCodePos(std::move(y.sourceCodePos))
     44    {
     45    }
     46
     47    WithInfo(WithInfo const& y)
     48        : name(y.name)
     49        , sourceCodePos(y.sourceCodePos)
     50    {
     51    }
     52
     53    WithInfo& operator =(WithInfo&& y)
     54    {
     55        name = std::move(y.name);
     56        sourceCodePos = std::move(y.sourceCodePos);
     57        return *this;
     58    }
     59
     60    WithInfo& operator =(WithInfo const& y)
     61    {
     62        return *this = std::move(WithInfo(y));
    3963    }
    4064};
     
    210234    int NewTempParameters( const std::string &procName, const Parameters &params, int SecondParmNum = -1 );
    211235    void DeleteTempParameters();
     236
     237private:
     238    ParamImpl(ParamImpl const&);
     239    ParamImpl& operator =(ParamImpl const&);
    212240};
    213241
Note: See TracChangeset for help on using the changeset viewer.