summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-30 23:46:27 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-30 23:46:27 +0000
commit21b719dfcf35a5d139d7eafaab0b3c2c7527ffa7 (patch)
tree67f4f0d0b33196c71429c9d6f1f22e5c64e5276e /include
parentd7bee4451b908b060316fc535801d9d98af9e2b4 (diff)
downloadllvm-21b719dfcf35a5d139d7eafaab0b3c2c7527ffa7.tar.gz
llvm-21b719dfcf35a5d139d7eafaab0b3c2c7527ffa7.tar.bz2
llvm-21b719dfcf35a5d139d7eafaab0b3c2c7527ffa7.tar.xz
LexicalScopes: Use unique_ptr to manage ownership of abstract LexicalScopes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/LexicalScopes.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LexicalScopes.h b/include/llvm/CodeGen/LexicalScopes.h
index 8ce280e35a..f5561a1b12 100644
--- a/include/llvm/CodeGen/LexicalScopes.h
+++ b/include/llvm/CodeGen/LexicalScopes.h
@@ -90,7 +90,8 @@ public:
/// findAbstractScope - Find an abstract scope or return NULL.
LexicalScope *findAbstractScope(const MDNode *N) {
- return AbstractScopeMap.lookup(N);
+ auto I = AbstractScopeMap.find(N);
+ return I != AbstractScopeMap.end() ? I->second.get() : nullptr;
}
/// findInlinedScope - Find an inlined scope for the given DebugLoc or return
@@ -144,7 +145,7 @@ private:
/// AbstractScopeMap - These scopes are not included LexicalScopeMap.
/// AbstractScopes owns its LexicalScope*s.
- DenseMap<const MDNode *, LexicalScope *> AbstractScopeMap;
+ DenseMap<const MDNode *, std::unique_ptr<LexicalScope>> AbstractScopeMap;
/// AbstractScopesList - Tracks abstract scopes constructed while processing
/// a function.