summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/DIContext.h
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2012-11-07 23:22:07 +0000
committerEric Christopher <echristo@gmail.com>2012-11-07 23:22:07 +0000
commit806e03d2381709ddfb5a8012729bbe6eae12caf5 (patch)
treed01da4fb8a09017a564b27968af88dc1fb82084d /include/llvm/DebugInfo/DIContext.h
parentb0319962cfdb18da38ef47da621f148fe144b092 (diff)
downloadllvm-806e03d2381709ddfb5a8012729bbe6eae12caf5.tar.gz
llvm-806e03d2381709ddfb5a8012729bbe6eae12caf5.tar.bz2
llvm-806e03d2381709ddfb5a8012729bbe6eae12caf5.tar.xz
Add a relocation visitor to lib object. This works via caching relocated
values in a map that can be passed to consumers. Add a testcase that ensures this works for llvm-dwarfdump. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DebugInfo/DIContext.h')
-rw-r--r--include/llvm/DebugInfo/DIContext.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h
index 8d6054aa45..2e34bacdd3 100644
--- a/include/llvm/DebugInfo/DIContext.h
+++ b/include/llvm/DebugInfo/DIContext.h
@@ -15,6 +15,7 @@
#ifndef LLVM_DEBUGINFO_DICONTEXT_H
#define LLVM_DEBUGINFO_DICONTEXT_H
+#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
@@ -89,6 +90,13 @@ public:
}
};
+// In place of applying the relocations to the data we've read from disk we use
+// a separate mapping table to the side and checking that at locations in the dwarf
+// we expec relocated values. This adds a bit of complexity to the dwarf
+// parsing/extraction at the benefit of not allocating memory for the entire
+// size of the debug info sections.
+typedef DenseMap<uint64_t, std::pair<uint8_t, int64_t> > RelocAddrMap;
+
class DIContext {
public:
virtual ~DIContext();
@@ -100,7 +108,8 @@ public:
StringRef aRangeSection = StringRef(),
StringRef lineSection = StringRef(),
StringRef stringSection = StringRef(),
- StringRef rangeSection = StringRef());
+ StringRef rangeSection = StringRef(),
+ const RelocAddrMap &Map = RelocAddrMap());
virtual void dump(raw_ostream &OS) = 0;