summaryrefslogtreecommitdiff
path: root/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
commitf05b45fdb2d04db7bc1cde4529ebe0afdb9be148 (patch)
tree9a61f45d821e89428889bb03b6ee7852984daf66 /lib/IR/LLVMContextImpl.h
parent9efaf2f2dad82d5455970af0370edace405791b2 (diff)
downloadllvm-f05b45fdb2d04db7bc1cde4529ebe0afdb9be148.tar.gz
llvm-f05b45fdb2d04db7bc1cde4529ebe0afdb9be148.tar.bz2
llvm-f05b45fdb2d04db7bc1cde4529ebe0afdb9be148.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/LLVMContextImpl.h')
-rw-r--r--lib/IR/LLVMContextImpl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/IR/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h
index 0433827246..8b94ab1c77 100644
--- a/lib/IR/LLVMContextImpl.h
+++ b/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;