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

Changeset 821:8f0b24bc55f0

Show
Ignore:
Timestamp:
12/01/08 19:44:17 (1 month ago)
Author:
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
branch:
default
Message:

Added CMake option to disable generation of ClassInfo?.offTi arrays, defaults to OFF.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CMakeLists.txt

    r785 r821  
    4242set(D_VERSION 1 CACHE STRING "D language version") 
    4343option(USE_BOEHM_GC "use the Boehm garbage collector internally") 
     44option(GENERATE_OFFTI "generate complete ClassInfo.offTi arrays") 
    4445 
    4546if(D_VERSION EQUAL 1) 
     
    143144endif(USE_BOEHM_GC) 
    144145 
     146if(GENERATE_OFFTI) 
     147    add_definitions(-DGENERATE_OFFTI) 
     148endif(GENERATE_OFFTI) 
     149 
    145150if(CMAKE_MINOR_VERSION LESS 6) 
    146151    set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "output dir for built executables") 
  • gen/classes.cpp

    r816 r821  
    13131313////////////////////////////////////////////////////////////////////////////////////////// 
    13141314 
     1315#if GENERATE_OFFTI 
     1316 
    13151317// build a single element for the OffsetInfo[] of ClassInfo 
    13161318static LLConstant* build_offti_entry(ClassDeclaration* cd, VarDeclaration* vd) 
     
    13711373    return DtoConstSlice(size, ptr); 
    13721374} 
     1375 
     1376#endif // GENERATE_OFFTI 
    13731377 
    13741378static LLConstant* build_class_dtor(ClassDeclaration* cd) 
     
    15821586    VarDeclaration* offTiVar = (VarDeclaration*)cinfo->fields.data[9]; 
    15831587    const LLType* offTiTy = DtoType(offTiVar->type); 
     1588 
     1589#if GENERATE_OFFTI 
     1590 
    15841591    if (cd->isInterfaceDeclaration()) 
    15851592        c = LLConstant::getNullValue(offTiTy); 
    15861593    else 
    15871594        c = build_offti_array(cd, offTiTy); 
     1595 
     1596#else // GENERATE_OFFTI 
     1597 
     1598    c = LLConstant::getNullValue(offTiTy); 
     1599 
     1600#endif // GENERATE_OFFTI 
     1601 
    15881602    inits.push_back(c); 
    15891603 
     
    16071621    // FIXME: fill it out! 
    16081622    inits.push_back( LLConstant::getNullValue(xgetTy) ); 
    1609  
    1610 #else 
    16111623#endif 
    16121624 
  • tests/mini/classinfo3.d

    r341 r821  
    1212{ 
    1313    auto c = C.classinfo; 
    14     assert(c.offTi !is null); 
     14    if (c.offTi !is null) 
     15    { 
    1516    assert(c.offTi.length == 4); 
    1617 
     
    2526    assert(c.offTi[3].offset == base+16); 
    2627    assert(c.offTi[3].ti == typeid(int)); 
     28    } 
    2729} 
Copyright © 2008, LDC Development Team.