mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
LexicalScopes: use unique_ptr to own LexicalScope objects.
Ownership of abstract scopes coming soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207724 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "llvm/IR/Metadata.h"
|
||||
#include "llvm/IR/ValueHandle.h"
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
namespace llvm {
|
||||
|
||||
class MachineInstr;
|
||||
@@ -100,7 +101,8 @@ public:
|
||||
|
||||
/// findLexicalScope - Find regular lexical scope or return NULL.
|
||||
LexicalScope *findLexicalScope(const MDNode *N) {
|
||||
return LexicalScopeMap.lookup(N);
|
||||
auto I = LexicalScopeMap.find(N);
|
||||
return I != LexicalScopeMap.end() ? I->second.get() : nullptr;
|
||||
}
|
||||
|
||||
/// dump - Print data structures to dbgs().
|
||||
@@ -134,7 +136,7 @@ private:
|
||||
|
||||
/// LexicalScopeMap - Tracks the scopes in the current function. Owns the
|
||||
/// contained LexicalScope*s.
|
||||
DenseMap<const MDNode *, LexicalScope *> LexicalScopeMap;
|
||||
DenseMap<const MDNode *, std::unique_ptr<LexicalScope>> LexicalScopeMap;
|
||||
|
||||
/// InlinedLexicalScopeMap - Tracks inlined function scopes in current
|
||||
/// function.
|
||||
|
Reference in New Issue
Block a user