aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenTarget.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-12-10 06:18:57 +0000
committerCraig Topper <craig.topper@gmail.com>2014-12-10 06:18:57 +0000
commit48a8e641e228f7aec182db4a4a469d9cdd41e8b9 (patch)
tree908eff6be567d098a2fb507077eea891db43bf9b /llvm/utils/TableGen/CodeGenTarget.h
parent04da06ccee2b15b131efd26d69401112d21e5d48 (diff)
downloadllvm-48a8e641e228f7aec182db4a4a469d9cdd41e8b9.zip
llvm-48a8e641e228f7aec182db4a4a469d9cdd41e8b9.tar.gz
llvm-48a8e641e228f7aec182db4a4a469d9cdd41e8b9.tar.bz2
Use unique_ptr instead of DeleteContainerSeconds.
llvm-svn: 223918
Diffstat (limited to 'llvm/utils/TableGen/CodeGenTarget.h')
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.h b/llvm/utils/TableGen/CodeGenTarget.h
index a46c9a6..24b3851 100644
--- a/llvm/utils/TableGen/CodeGenTarget.h
+++ b/llvm/utils/TableGen/CodeGenTarget.h
@@ -65,7 +65,8 @@ class CodeGenTarget {
RecordKeeper &Records;
Record *TargetRec;
- mutable DenseMap<const Record*, CodeGenInstruction*> Instructions;
+ mutable DenseMap<const Record*,
+ std::unique_ptr<CodeGenInstruction>> Instructions;
mutable std::unique_ptr<CodeGenRegBank> RegBank;
mutable std::vector<Record*> RegAltNameIndices;
mutable SmallVector<MVT::SimpleValueType, 8> LegalValueTypes;
@@ -146,7 +147,8 @@ public:
CodeGenSchedModels &getSchedModels() const;
private:
- DenseMap<const Record*, CodeGenInstruction*> &getInstructions() const {
+ DenseMap<const Record*, std::unique_ptr<CodeGenInstruction>> &
+ getInstructions() const {
if (Instructions.empty()) ReadInstructions();
return Instructions;
}
@@ -154,8 +156,7 @@ public:
CodeGenInstruction &getInstruction(const Record *InstRec) const {
if (Instructions.empty()) ReadInstructions();
- DenseMap<const Record*, CodeGenInstruction*>::iterator I =
- Instructions.find(InstRec);
+ auto I = Instructions.find(InstRec);
assert(I != Instructions.end() && "Not an instruction");
return *I->second;
}