mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Debug Info: remove duplication of DIEs when a DIE can be shared across CUs.
We add a map in DwarfDebug to map MDNodes that are shareable across CUs to the corresponding DIEs: MDTypeNodeToDieMap. These DIEs can be shared across CUs, that is why we keep the maps in DwarfDebug instead of CompileUnit. We make the assumption that if a DIE is not added to an owner yet, we assume it belongs to the current CU. Since DIEs for the type system are added to their owners immediately after creation, and other DIEs belong to the current CU, the assumption should be true. 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. We also add a testing case to show ref_addr relocations for non-darwin platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -155,15 +155,19 @@ public:
|
||||
void addAccelType(StringRef Name, std::pair<DIE *, unsigned> Die);
|
||||
|
||||
/// getDIE - Returns the debug information entry map slot for the
|
||||
/// specified debug variable.
|
||||
DIE *getDIE(const MDNode *N) const { return MDNodeToDieMap.lookup(N); }
|
||||
/// specified debug variable. We delegate the request to DwarfDebug
|
||||
/// when the MDNode can be part of the type system, since DIEs for
|
||||
/// the type system can be shared across CUs and the mappings are
|
||||
/// kept in DwarfDebug.
|
||||
DIE *getDIE(const MDNode *N) const;
|
||||
|
||||
DIEBlock *getDIEBlock() { return new (DIEValueAllocator) DIEBlock(); }
|
||||
|
||||
/// insertDIE - Insert DIE into the map.
|
||||
void insertDIE(const MDNode *N, DIE *D) {
|
||||
MDNodeToDieMap.insert(std::make_pair(N, D));
|
||||
}
|
||||
/// insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug
|
||||
/// when the MDNode can be part of the type system, since DIEs for
|
||||
/// the type system can be shared across CUs and the mappings are
|
||||
/// kept in DwarfDebug.
|
||||
void insertDIE(const MDNode *N, DIE *D);
|
||||
|
||||
/// addDie - Adds or interns the DIE to the compile unit.
|
||||
///
|
||||
@@ -224,6 +228,10 @@ public:
|
||||
///
|
||||
void addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIE *Entry);
|
||||
|
||||
/// addDIEEntry - Add a DIE attribute data and value.
|
||||
///
|
||||
void addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIEEntry *Entry);
|
||||
|
||||
/// addBlock - Add block data.
|
||||
///
|
||||
void addBlock(DIE *Die, dwarf::Attribute Attribute, DIEBlock *Block);
|
||||
|
Reference in New Issue
Block a user