Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login
Show
Ignore:
Timestamp:
05/19/10 06:42:32 (2 years ago)
Author:
Tomas Lindquist Olsen
branch:
default
Message:

Update to work with LLVM 2.7.

Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).

Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.

Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.

Files:

Legend:

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

    r1645 r1650  
    149149    global.params.objfiles = new Array(); 
    150150    global.params.ddocfiles = new Array(); 
    151      
     151 
    152152    global.params.moduleDeps = NULL; 
    153153    global.params.moduleDepsFile = NULL; 
     
    224224    initFromString(global.params.objname, objectFile); 
    225225    initFromString(global.params.objdir, objectDir); 
    226      
     226 
    227227    initFromString(global.params.docdir, ddocDir); 
    228228    initFromString(global.params.docname, ddocFile); 
    229229    global.params.doDocComments |= 
    230230        global.params.docdir || global.params.docname; 
    231      
     231 
    232232#ifdef _DH 
    233233    initFromString(global.params.hdrdir, hdrDir); 
     
    238238 
    239239    initFromString(global.params.moduleDepsFile, moduleDepsFile); 
    240     if (global.params.moduleDepsFile != NULL)  
    241     {  
    242          global.params.moduleDeps = new OutBuffer;  
     240    if (global.params.moduleDepsFile != NULL) 
     241    { 
     242         global.params.moduleDeps = new OutBuffer; 
    243243    } 
    244244 
     
    436436 
    437437    // Allocate target machine. 
    438      
     438 
    439439    // first initialize llvm 
    440440#define LLVM_TARGET(A) LLVMInitialize##A##TargetInfo(); LLVMInitialize##A##Target(); LLVMInitialize##A##AsmPrinter(); 
     
    485485    } 
    486486 
    487     std::auto_ptr<llvm::TargetMachine> target(theTarget->createTargetMachine(triple, FeaturesStr)); 
    488     assert(target.get() && "Could not allocate target machine!"); 
    489     gTargetMachine = target.get(); 
    490     gTargetData = gTargetMachine->getTargetData(); 
     487    // FIXME 
     488    //std::auto_ptr<llvm::TargetMachine> target(theTarget->createTargetMachine(triple, FeaturesStr)); 
     489    //assert(target.get() && "Could not allocate target machine!"); 
     490    //gTargetMachine = target.get(); 
     491 
     492    llvm::TargetMachine* target = theTarget->createTargetMachine(triple, FeaturesStr); 
     493    gTargetMachine = target; 
     494 
     495    gTargetData = target->getTargetData(); 
    491496 
    492497    // get final data layout 
     
    904909 
    905910    // write module dependencies to file if requested 
    906     if (global.params.moduleDepsFile != NULL)  
    907     {  
     911    if (global.params.moduleDepsFile != NULL) 
     912    { 
    908913        assert (global.params.moduleDepsFile != NULL); 
    909914 
    910915        File deps(global.params.moduleDepsFile); 
    911         OutBuffer* ob = global.params.moduleDeps;  
     916        OutBuffer* ob = global.params.moduleDeps; 
    912917        deps.setbuffer((void*)ob->data, ob->offset); 
    913918        deps.write(); 
     
    945950        } 
    946951    } 
    947      
     952 
    948953    // internal linking for singleobj 
    949954    if (singleObj && llvmModules.size() > 0) 
     
    952957        char* name = m->toChars(); 
    953958        char* filename = m->objfile->name->str; 
    954          
     959 
    955960        llvm::Linker linker(name, name, context); 
    956961 
     
    962967            delete llvmModules[i]; 
    963968        } 
    964          
     969 
    965970        m->deleteObjFile(); 
    966971        writeModule(linker.getModule(), filename); 
    967972        global.params.objfiles->push(filename); 
    968973    } 
    969      
     974 
    970975    backend_term(); 
    971976    if (global.errors) 
Copyright © 2008, LDC Development Team.