summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DIE.h
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-10-29 22:57:10 +0000
committerManman Ren <manman.ren@gmail.com>2013-10-29 22:57:10 +0000
commit3eabc2adb7387c97da547e250997ed0a8d5e6d3d (patch)
tree4580cf585f2e7c5bd6d24644e6172afc1553b287 /lib/CodeGen/AsmPrinter/DIE.h
parentd498e5e960f237d3eb04ad7680bd093d1954c7fe (diff)
downloadllvm-3eabc2adb7387c97da547e250997ed0a8d5e6d3d.tar.gz
llvm-3eabc2adb7387c97da547e250997ed0a8d5e6d3d.tar.bz2
llvm-3eabc2adb7387c97da547e250997ed0a8d5e6d3d.tar.xz
Debug Info: support for DW_FORM_ref_addr.
To support ref_addr, we calculate the section offset of a DIE (i.e. offset of a DIE from beginning of the debug info section). The Offset field in DIE is currently CU-relative. To calculate the section offset, we add a DebugInfoOffset field in CompileUnit to store the offset of a CU from beginning of the debug info section. We set the value in DwarfUnits::computeSizeAndOffset for each CompileUnit. A helper function DIE::getCompileUnit is added to return the CU DIE that the input DIE belongs to. We also add a map CUDieMap in DwarfDebug to help finding the CU for a given CU DIE. For a cross-referenced DIE, we first find the CU DIE it belongs to with getCompileUnit, then we use CUDieMap to get the corresponding CU for the CU DIE. Adding the section offset of the CU with the CU-relative offset of a DIE gives us the seciton offset of the DIE. We correctly emit ref_addr with relocation using EmitLabelPlusOffset when doesDwarfUseRelocationsAcrossSections is true. This commit handles the emission of DW_FORM_ref_addr when we have an attribute with FORM_ref_addr. A follow-on patch will start using ref_addr when adding a DIEEntry. This commit will be tested and verified in the follow-on patch. Reviewed off-list by Eric, Thanks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193658 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIE.h')
-rw-r--r--lib/CodeGen/AsmPrinter/DIE.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.h b/lib/CodeGen/AsmPrinter/DIE.h
index 6d4f305c84..96a01327f7 100644
--- a/lib/CodeGen/AsmPrinter/DIE.h
+++ b/lib/CodeGen/AsmPrinter/DIE.h
@@ -146,6 +146,9 @@ namespace llvm {
const std::vector<DIE *> &getChildren() const { return Children; }
const SmallVectorImpl<DIEValue*> &getValues() const { return Values; }
DIE *getParent() const { return Parent; }
+ /// Climb up the parent chain to get the compile unit DIE this DIE belongs
+ /// to.
+ const DIE *getCompileUnit() const;
void setOffset(unsigned O) { Offset = O; }
void setSize(unsigned S) { Size = S; }