Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 1527:f19adff18813

Show
Ignore:
Timestamp:
07/09/09 07:36:08 (7 months ago)
Author:
Robert Clipsham <robert@octarineparrot.com>
branch:
default
Message:

A couple of ldc2 tweaks now druntime compiles.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gen/main.cpp

    Revision 1524:b265fb6ce15b Revision 1527:f19adff18813
    301    { 301    { 
    302        libs = global.params.debuglibnames; 302        libs = global.params.debuglibnames; 
    303        llvm::NoFramePointerElim = true; 303        llvm::NoFramePointerElim = true; 
    304    } 304    } 
    305    else 305    else 
    306        libs = global.params.defaultlibnames; 306        libs = global.params.defaultlibnames; 
    307 307 
    308    if (libs) 308    if (libs) 
    309    { 309    { 
    310        for (int i = 0; i < libs->dim; i++) 310        for (int i = 0; i < libs->dim; i++) 
    311        { 311        { 
    312            char* lib = (char *)libs->data[i]; 312            char* lib = (char *)libs->data[i]; 
    313            char *arg = (char *)mem.malloc(strlen(lib) + 3); 313            char *arg = (char *)mem.malloc(strlen(lib) + 3); 
    314            strcpy(arg, "-l"); 314            strcpy(arg, "-l"); 
    315            strcpy(arg+2, lib); 315            strcpy(arg+2, lib); 
    316            global.params.linkswitches->push(arg); 316            global.params.linkswitches->push(arg); 
    317        } 317        } 
    318    } 318    } 
    319    else if (!noDefaultLib) 319    else if (!noDefaultLib) 
    320    { 320    { 
    321#if !DMDV2  321 #if DMDV2 
       322     global.params.linkswitches->push(mem.strdup("-ldruntime-ldc")); 
       323 #else 
    322        global.params.linkswitches->push(mem.strdup("-lldc-runtime")); 324        global.params.linkswitches->push(mem.strdup("-lldc-runtime")); 
    323        global.params.linkswitches->push(mem.strdup("-ltango-cc-tango")); 325        global.params.linkswitches->push(mem.strdup("-ltango-cc-tango")); 
    324        global.params.linkswitches->push(mem.strdup("-ltango-gc-basic")); 326        global.params.linkswitches->push(mem.strdup("-ltango-gc-basic")); 
    325        // pass the runtime again to resolve issues 327        // pass the runtime again to resolve issues 
    326        // with linking order 328        // with linking order 
    327        global.params.linkswitches->push(mem.strdup("-lldc-runtime")); 329        global.params.linkswitches->push(mem.strdup("-lldc-runtime")); 
    328#endif 330#endif 
    329    } 331    } 
    330 332 
    331    if (global.params.run) 333    if (global.params.run) 
    332        quiet = 1; 334        quiet = 1; 
    333 335 
    334    if (global.params.useUnitTests) 336    if (global.params.useUnitTests) 
    335        global.params.useAssert = 1; 337        global.params.useAssert = 1; 
    336 338 
    337    // LDC output determination 339    // LDC output determination 
    338 340 
    339    // if we don't link, autodetect target from extension 341    // if we don't link, autodetect target from extension 
    340    if(!global.params.link && global.params.objname) { 342    if(!global.params.link && global.params.objname) { 
    341        ext = FileName::ext(global.params.objname); 343        ext = FileName::ext(global.params.objname); 
  • gen/runtime.cpp

    Revision 1524:b265fb6ce15b Revision 1527:f19adff18813
    319            ->setAttributes(Attr_NoAlias_3_NoCapture); 319            ->setAttributes(Attr_NoAlias_3_NoCapture); 
    320    } 320    } 
    321 321 
    322    // void* _d_arraysetlengthT(TypeInfo ti, size_t newlength, size_t plength, void* pdata) 322    // void* _d_arraysetlengthT(TypeInfo ti, size_t newlength, size_t plength, void* pdata) 
    323    // void* _d_arraysetlengthiT(TypeInfo ti, size_t newlength, size_t plength, void* pdata) 323    // void* _d_arraysetlengthiT(TypeInfo ti, size_t newlength, size_t plength, void* pdata) 
    324    { 324    { 
    325        std::string fname("_d_arraysetlengthT"); 325        std::string fname("_d_arraysetlengthT"); 
    326        std::string fname2("_d_arraysetlengthiT"); 326        std::string fname2("_d_arraysetlengthiT"); 
    327        std::vector<const LLType*> types; 327        std::vector<const LLType*> types; 
    328        types.push_back(typeInfoTy); 328        types.push_back(typeInfoTy); 
    329        types.push_back(sizeTy); 329        types.push_back(sizeTy); 
    330        types.push_back(sizeTy); 330        types.push_back(sizeTy); 
    331        types.push_back(voidPtrTy); 331        types.push_back(voidPtrTy); 
    332        const llvm::FunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); 332        const llvm::FunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); 
    333        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 333        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 
    334        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M); 334        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M); 
    335    } 335    } 
    336 336 
    337    // Object _d_allocclass(ClassInfo ci) 337    // Object _d_allocclass(ClassInfo ci) 
    338    { 338    { 
    339#if DMDV2   
    340        std::string fname("_d_newclass");   
    341#else   
    342        std::string fname("_d_allocclass"); 339        std::string fname("_d_allocclass"); 
    343#endif   
    344        std::vector<const LLType*> types; 340        std::vector<const LLType*> types; 
    345        types.push_back(classInfoTy); 341        types.push_back(classInfoTy); 
    346        const llvm::FunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); 342        const llvm::FunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); 
    347        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M) 343        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M) 
    348            ->setAttributes(Attr_NoAlias); 344            ->setAttributes(Attr_NoAlias); 
    349    } 345    } 
    350 346 
    351    // void _d_delarray(size_t plength, void* pdata) 347    // void _d_delarray(size_t plength, void* pdata) 
    352    { 348    { 
    353        std::string fname("_d_delarray"); 349        std::string fname("_d_delarray"); 
    354        std::vector<const LLType*> types; 350        std::vector<const LLType*> types; 
    355        types.push_back(sizeTy); 351        types.push_back(sizeTy); 
    356        types.push_back(voidPtrTy); 352        types.push_back(voidPtrTy); 
    357        const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 353        const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false); 
    358        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 354        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); 
    359    } 355    } 
    360 356 
    361    // void _d_delmemory(void* p) 357    // void _d_delmemory(void* p) 
    362    // void _d_delinterface(void* p) 358    // void _d_delinterface(void* p) 
    363    // void _d_callfinalizer(void* p) 359    // void _d_callfinalizer(void* p) 
Copyright © 2008, LDC Development Team.