Changeset 294 in dev for trunk


Ignore:
Timestamp:
Aug 22, 2007, 11:23:28 PM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/abdev
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler32/BasicCompiler.vcproj

    r288 r294  
    7676            <Tool
    7777                Name="VCLinkerTool"
    78                 AdditionalDependencies="comctl32.lib psapi.lib commond.lib smoothied.lib"
     78                AdditionalDependencies="comctl32.lib psapi.lib commond.lib smoothied.lib imagehlp.lib"
    7979                OutputFile="../ActiveBasic/BasicCompiler32.exe"
    8080                LinkIncremental="2"
     
    179179            <Tool
    180180                Name="VCLinkerTool"
    181                 AdditionalDependencies="comctl32.lib psapi.lib common.lib smoothie.lib"
     181                AdditionalDependencies="comctl32.lib psapi.lib common.lib smoothie.lib imagehlp.lib"
    182182                OutputFile="../ActiveBasic/BasicCompiler32.exe"
    183183                LinkIncremental="1"
  • trunk/abdev/BasicCompiler32/Compile_CallProc.cpp

    r292 r294  
    135135        else{
    136136            if(dwFlags&PROCFLAG_NEW){
     137                GetVarType( ObjectName, leftType, false );
     138
    137139                //New演算子によるコンストラクタ呼び出し
    138140                pobj_c=pUserProc->GetParentClassPtr();
  • trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp

    r290 r294  
    507507                compiler.codeGenerator.op_mov_RV_vtbl( REG_EAX, compiler.pCompilingClass );
    508508
    509                 /* TODO: 消す
    510                 //関数テーブルに値をセット
    511                 int offset = (int)compiler.pCompilingClass->GetVtblGlobalOffset();
    512 
    513                 //mov eax,offset
    514                 compiler.codeGenerator.op_mov_RV( REG_EAX, offset, Schedule::DataTable );
    515                 */
    516 
    517509                //Thisポインタをecxにコピー
    518510                SetThisPtrToReg(REG_ECX);
  • trunk/abdev/BasicCompiler32/MakePeHdr.cpp

    r290 r294  
    22
    33#include <jenga/include/common/Environment.h>
     4#include <jenga/include/common/Path.h>
     5#include <jenga/include/common/Directory.h>
    46
    57#include <jenga/include/smoothie/Smoothie.h>
     
    381383
    382384
    383 
    384         //push ebp
    385         compiler.codeGenerator.op_push(REG_EBP);
    386 
    387         if(bDebugCompile){
    388             //デバッグ用の変数を定義
    389             // TODO: 暫定処理なので下のif文は正しくない
    390             //if( compiler.IsStaticLibrary() )
     385        if( compiler.IsCore() )
     386        {
     387            // コアモジュール(basic.sbp)をコンパイルするとき
     388
     389            //push ebp
     390            compiler.codeGenerator.op_push(REG_EBP);
     391
     392            if(bDebugCompile)
    391393            {
     394                //デバッグ用の変数を定義
    392395                DebugVariable();
    393396            }
    394         }
    395 
    396         //GC用の変数を定義
    397         InitGCVariables();
    398 
    399         //if( compiler.IsStaticLibrary() )
    400         {
     397
     398            //GC用の変数を定義
     399            InitGCVariables();
     400
    401401            //_System_StartupProgramの呼び出し
    402402            compiler.codeGenerator.op_call(pSub_System_StartupProgram);
     
    497497        // 静的リンクライブラリ
    498498
     499        // 格納先ディレクトリを作る
     500        Jenga::Common::Path path( OutputFileName );
     501        Jenga::Common::Directory dir( path.GetDriveName() + path.GetDirName(), true );
     502
     503        // 書き込む
    499504        if( !compiler.GetObjectModule().Write( OutputFileName ) )
    500505        {
  • trunk/abdev/BasicCompiler_Common/BasicCompiler.cpp

    r279 r294  
    778778    }
    779779
    780     //インクルードディレクトリが指定されなかったとき
    781     if(szIncludeDir[0]=='\0'){
    782         lstrcpy(szIncludeDir,".\\Include\\");
    783     }
    784 
    785     //インクルードディレクトリを絶対パスに変更
    786     GetFullPath(szIncludeDir,(Jenga::Common::Environment::GetAppDir()+"\\").c_str());
     780    {
     781        // カレントディレクトリを取得
     782        char currentDirPath[MAX_PATH];
     783        GetCurrentDirectory( MAX_PATH, currentDirPath );
     784        if( currentDirPath[lstrlen(currentDirPath)-1] != '\\' )
     785        {
     786            lstrcat( currentDirPath, "\\" );
     787        }
     788
     789        // インクルードディレクトリが指定されなかったとき
     790        if(szIncludeDir[0]=='\0'){
     791            lstrcpy(szIncludeDir,".\\Include\\");
     792
     793            // インクルードディレクトリを絶対パスに変更
     794            GetFullPath(szIncludeDir,(Jenga::Common::Environment::GetAppDir()+"\\").c_str());
     795        }
     796        else
     797        {
     798            // インクルードディレクトリを絶対パスに変更
     799            GetFullPath(szIncludeDir,currentDirPath);
     800        }
     801
     802        // ソースファイル名を絶対パスに変換
     803        GetFullPath(SourceFileName,currentDirPath);
     804
     805        // 出力ファイル名を絶対パスに変換
     806        GetFullPath(OutputFileName,currentDirPath);
     807    }
    787808
    788809    if( compiler.IsDll() ){
  • trunk/abdev/BasicCompiler_Common/Intermediate_Step1.cpp

    r287 r294  
    11#include "stdafx.h"
    2 
    3 #include <jenga/include/common/Path.h>
    42
    53#include <jenga/include/smoothie/Smoothie.h>
     
    256254                compiler.staticLibraryFilePaths.push_back( temporary );
    257255
    258                 compiler.staticLibraries.push_back( new ObjectModule() );
    259 
    260                 Jenga::Common::Path path( temporary );
    261                 CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
    262                 compiler.staticLibraries.back()->Read( temporary );
     256                for(;;i2++){
     257                    if(basbuf[i2]=='\n'||basbuf[i2]=='\0') break;
     258                }
     259                SlideString(basbuf+i2,i-i2);
     260            }
     261            else if( lstrcmpi( temporary, "_core" ) == 0 )
     262            {
     263                // #_core
     264                // コアモジュール
     265                compiler.SetCoreMark( true );
    263266
    264267                for(;;i2++){
  • trunk/abdev/BasicCompiler_Common/MakeExe.cpp

    r280 r294  
    22
    33#include <jenga/include/smoothie/Smoothie.h>
     4#include <jenga/include/common/Path.h>
    45
    56#include <Compiler.h>
     
    130131
    131132    StepCompileProgress();
     133
     134
     135    /////////////////////////////////////////////////////////////////
     136    // 静的リンクライブラリをロードする
     137    /////////////////////////////////////////////////////////////////
     138
     139    if( !compiler.IsCore() )
     140    {
     141        // コアモジュールをロードする
     142        extern BOOL bDebugCompile;
     143        extern char szIncludeDir[MAX_PATH];
     144
     145        const char *coreFileName = "core.lib";
     146        if( bDebugCompile )
     147        {
     148            coreFileName = "cored.lib";
     149        }
     150
     151        char coreFilePath[MAX_PATH];
     152        sprintf( coreFilePath, "..\\lib\\%s", coreFileName );
     153        GetFullPath( coreFilePath, szIncludeDir );
     154
     155        compiler.staticLibraries.push_back( new ObjectModule() );
     156        compiler.staticLibraries.back()->Read( coreFilePath );
     157    }
     158
     159    BOOST_FOREACH( const std::string &filePath, compiler.staticLibraryFilePaths )
     160    {
     161        compiler.staticLibraries.push_back( new ObjectModule() );
     162        compiler.staticLibraries.back()->Read( filePath );
     163
     164        Jenga::Common::Path path( filePath );
     165        CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
     166    }
    132167
    133168
  • trunk/abdev/BasicCompiler_Common/include/Compiler.h

    r279 r294  
    2424        , pNowObjectModule( pObjectModule )
    2525        , targetModuleType( Exe )
     26        , isCore( false )
    2627    {
    2728    }
     
    110111
    111112
     113    // コアモジュールかどうか
     114    bool isCore;
     115    void SetCoreMark( bool isCore )
     116    {
     117        this->isCore = isCore;
     118    }
     119    bool IsCore() const
     120    {
     121        return isCore;
     122    }
     123
     124
    112125    static bool StringToType( const std::string &typeName, Type &type );
    113126    static const std::string TypeToString( const Type &type );
  • trunk/abdev/BasicCompiler_Common/src/Source.cpp

    r290 r294  
    815815
    816816    // basic.sbpをインクルード
    817     const char *headCode = "#include <basic.sbp>\n";
    818     //const char *headCode = "\n";
     817    //const char *headCode = "#include <basic.sbp>\n";
     818    const char *headCode = "";
    819819    Realloc( length + lstrlen(headCode) );
    820820    Text::SlideString( buffer, lstrlen(headCode) );
Note: See TracChangeset for help on using the changeset viewer.