Skip to content
  • Manman Ren's avatar
    Debug Info: remove duplication of DIEs when a DIE is part of the type system · 8990d7ee
    Manman Ren authored
    and it is shared across CUs.
    
    We add a few maps in DwarfDebug to map MDNodes for the type system to the
    corresponding DIEs: MDTypeNodeToDieMap, MDSPNodeToDieMap, and
    MDStaticMemberNodeToDieMap. These DIEs can be shared across CUs, that is why we
    keep the maps in DwarfDebug instead of CompileUnit.
    
    Sometimes, when we try to add an attribute to a DIE, the DIE is not yet added
    to its owner yet, so we don't know whether we should use ref_addr or ref4.
    We create a worklist that will be processed during finalization to add
    attributes with the correct form (ref_addr or ref4).
    
    We add addDIEEntry to DwarfDebug to be a wrapper around DIE->addValue. It checks
    whether we know the correct form, if not, we update the worklist
    (DIEEntryWorklist).
    
    A testing case is added to show that we only create a single DIE for a type
    MDNode and we use ref_addr to refer to the type DIE.
    
    llvm-svn: 191792
    8990d7ee
Loading