summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGParser.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-12-11 05:25:30 +0000
committerCraig Topper <craig.topper@gmail.com>2014-12-11 05:25:30 +0000
commit7adf2bf76a10bc873ebf9d3a88209a44bd7ad799 (patch)
treebc90c8137ae97dd64d671991793db6be5e2204d9 /llvm/lib/TableGen/TGParser.h
parent611a3ef0bcc26f5008ba1a61f600e11866a1bb49 (diff)
downloadbcm5719-llvm-7adf2bf76a10bc873ebf9d3a88209a44bd7ad799.tar.gz
bcm5719-llvm-7adf2bf76a10bc873ebf9d3a88209a44bd7ad799.zip
Replace std::map<K, V*> with std::map<K, std::unique_ptr<V>> to handle ownership and deletion of the values.
Ideally we would store the MultiClasses by value directly in the maps, but I had some trouble with that before and this at least fixes the leak. llvm-svn: 223997
Diffstat (limited to 'llvm/lib/TableGen/TGParser.h')
-rw-r--r--llvm/lib/TableGen/TGParser.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/TableGen/TGParser.h b/llvm/lib/TableGen/TGParser.h
index 79994cbc1a6..22a00e59195 100644
--- a/llvm/lib/TableGen/TGParser.h
+++ b/llvm/lib/TableGen/TGParser.h
@@ -55,7 +55,7 @@ namespace llvm {
class TGParser {
TGLexer Lex;
std::vector<std::vector<LetRecord> > LetStack;
- std::map<std::string, MultiClass*> MultiClasses;
+ std::map<std::string, std::unique_ptr<MultiClass>> MultiClasses;
/// Loops - Keep track of any foreach loops we are within.
///
OpenPOWER on IntegriCloud