Skip to content
  • Rui Ueyama's avatar
    COFF: Devirtualize mark(), markLive() and isCOMDAT(). · fc510f4c
    Rui Ueyama authored
    Only SectionChunk can be dead-stripped. Previously,
    all types of chunks implemented these functions,
    but their functions were blank.
    
    Likewise, only DefinedRegular and DefinedCOMDAT symbols
    can be dead-stripped. markLive() function was implemented
    for other symbol types, but they were blank.
    
    I started thinking that the change I made in r240319 was
    a mistake. I separated DefinedCOMDAT from DefinedRegular
    because I thought that would make the code cleaner, but now
    we want to handle them as the same type here. Maybe we
    should roll it back.
    
    This change should improve readability a bit as this removes
    some dubious uses of reinterpret_cast. Previously, we
    assumed that all COMDAT chunks are actually SectionChunks,
    which was not very obvious.
    
    llvm-svn: 240675
    fc510f4c
Loading