summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LLVMContextImpl.h
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-03-03 20:06:11 +0000
committerDiego Novillo <dnovillo@google.com>2014-03-03 20:06:11 +0000
commitf5041ce5583fd0dbdb362a92571a4709d063d0c1 (patch)
tree4ffc06ad33d4915d28009605c912d01c2e8f545a /llvm/lib/IR/LLVMContextImpl.h
parentb2f034b85e001fd79617f2124560509583118c13 (diff)
downloadbcm5719-llvm-f5041ce5583fd0dbdb362a92571a4709d063d0c1.tar.gz
bcm5719-llvm-f5041ce5583fd0dbdb362a92571a4709d063d0c1.zip
Pass to emit DWARF path discriminators.
DWARF discriminators are used to distinguish multiple control flow paths on the same source location. When this happens, instructions across basic block boundaries will share the same debug location. This pass detects this situation and creates a new lexical scope to one of the two instructions. This lexical scope is a child scope of the original and contains a new discriminator value. This discriminator is then picked up from MCObjectStreamer::EmitDwarfLocDirective to be written on the object file. This fixes http://llvm.org/bugs/show_bug.cgi?id=18270. llvm-svn: 202752
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.h')
-rw-r--r--llvm/lib/IR/LLVMContextImpl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index 04338272463..8b94ab1c779 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -352,7 +352,12 @@ public:
/// for an index. The ValueHandle ensures that ScopeINlinedAtIdx stays up
/// to date.
std::vector<std::pair<DebugRecVH, DebugRecVH> > ScopeInlinedAtRecords;
-
+
+ /// DiscriminatorTable - This table maps file:line locations to an
+ /// integer representing the next DWARF path discriminator to assign to
+ /// instructions in different blocks at the same location.
+ DenseMap<std::pair<const char *, unsigned>, unsigned> DiscriminatorTable;
+
/// IntrinsicIDCache - Cache of intrinsic name (string) to numeric ID mappings
/// requested in this context
typedef DenseMap<const Function*, unsigned> IntrinsicIDCacheTy;
OpenPOWER on IntegriCloud