DebugInfo: Include lexical scopes in inlined subroutines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-05-11 18:12:17 +00:00
parent db692e7d55
commit 99ccb1fae7
5 changed files with 130 additions and 21 deletions

View File

@@ -21,6 +21,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/ValueHandle.h"
@@ -185,9 +186,7 @@ public:
/// findInlinedScope - Find an inlined scope for the given DebugLoc or return
/// NULL.
LexicalScope *findInlinedScope(DebugLoc DL) {
return InlinedLexicalScopeMap.lookup(DL);
}
LexicalScope *findInlinedScope(DebugLoc DL);
/// findLexicalScope - Find regular lexical scope or return null.
LexicalScope *findLexicalScope(const MDNode *N) {
@@ -230,7 +229,9 @@ private:
/// InlinedLexicalScopeMap - Tracks inlined function scopes in current
/// function.
DenseMap<DebugLoc, LexicalScope *> InlinedLexicalScopeMap;
std::unordered_map<std::pair<const MDNode *, const MDNode *>, LexicalScope,
pair_hash<const MDNode *, const MDNode *>>
InlinedLexicalScopeMap;
/// AbstractScopeMap - These scopes are not included LexicalScopeMap.
// Use an unordered_map to ensure value pointer validity over insertion.