Changeset 120 in dev for BasicCompiler_Common


Ignore:
Timestamp:
May 13, 2007, 8:50:04 AM (17 years ago)
Author:
dai_9181
Message:

Parameter::Equals静的メソッドを廃止し、Parameters::Equalsメソッドを用意。
ポインタに要するサイズよりも一回り大きなアラインメントが指定されているときに、呼び出し側のオフセットズレを考慮するよう、修正

Location:
BasicCompiler_Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Class.cpp

    r117 r120  
    10891089
    10901090        if( method->pUserProc->GetName() == temporary ){
    1091             if( Parameter::Equals( method->pUserProc->Params(), pUserProc->Params() ) ){
     1091            if( method->pUserProc->Params().Equals( pUserProc->Params() ) ){
    10921092                //関数名、パラメータ属性が合致したとき
    10931093                SetError(15,pUserProc->GetName().c_str(),nowLine);
     
    11031103    foreach( CMethod *method, pobj_c->methods ){
    11041104        if( method->pUserProc->GetName() == temporary ){
    1105             if( Parameter::Equals( method->pUserProc->Params(), pUserProc->Params() ) ){
     1105            if( method->pUserProc->Params().Equals( pUserProc->Params() ) ){
    11061106
    11071107                if(method->bVirtual){
  • BasicCompiler_Common/Parameter.h

    r78 r120  
    22
    33#include "Type.h"
    4 
    5 class Parameter;
    6 typedef vector<Parameter *> Parameters;
    74
    85class Parameter : public Type
     
    8885        return false;
    8986    }
     87};
    9088
     89class Parameters : public vector<Parameter *>
     90{
     91public:
    9192
    92     static bool Equals( const Parameters &paramsA, const Parameters paramsB ){
    93         if( paramsA.size() != paramsB.size() ){
     93    bool Equals( const Parameters &params ) const
     94    {
     95        if( this->size() != params.size() ){
    9496            return false;
    9597        }
    9698
    97         int max = (int)paramsA.size();
     99        int max = (int)this->size();
    98100        for( int i=0; i<max; i++ ){
    99             if( !paramsA[i]->Equals( *paramsB[i] ) ){
     101            if( !(*this)[i]->Equals( *params[i] ) ){
    100102                return false;
    101103            }
     
    104106        return true;
    105107    }
     108
     109    int GetMemorySize() const
     110    {
     111        return (int)this->size() * PTR_SIZE;
     112    }
    106113};
  • BasicCompiler_Common/Subroutine.cpp

    r113 r120  
    622622                //重複エラーチェックを行う
    623623                if( pUserProc->IsEqualSymbol( *psi2 ) ){
    624                     if( Parameter::Equals( psi2->Params(), pUserProc->Params() ) ){
     624                    if( psi2->Params().Equals( pUserProc->Params() ) ){
    625625                        SetError(15,pUserProc->GetName().c_str(),nowLine);
    626626                        return 0;
Note: See TracChangeset for help on using the changeset viewer.