diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-24 20:19:13 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-24 20:19:13 +0000 |
commit | 14a384bee634ff5c3f5836a9ff6f5a9449d5173d (patch) | |
tree | 6e5e2e4119414dbaf8f6e8fc0f175c631f7aa200 /llvm/lib/IR/Metadata.cpp | |
parent | 391fc56ffd1831565ce3050442a562529665d101 (diff) | |
download | bcm5719-llvm-14a384bee634ff5c3f5836a9ff6f5a9449d5173d.tar.gz bcm5719-llvm-14a384bee634ff5c3f5836a9ff6f5a9449d5173d.zip |
IR: Remove MDMapTy and MDPairTy typedefs, NFC
Remove some typedefs in preparation for factoring out attachment logic
from `Instruction`.
llvm-svn: 235764
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r-- | llvm/lib/IR/Metadata.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 886c084fb99..6e54fa918b3 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -997,8 +997,7 @@ void Instruction::dropUnknownMetadata(ArrayRef<unsigned> KnownIDs) { if (!hasMetadataHashEntry()) return; // Nothing to remove! - DenseMap<const Instruction *, LLVMContextImpl::MDMapTy> &InstructionMetadata = - getContext().pImpl->InstructionMetadata; + auto &InstructionMetadata = getContext().pImpl->InstructionMetadata; if (KnownSet.empty()) { // Just drop our entry at the store. @@ -1007,7 +1006,7 @@ void Instruction::dropUnknownMetadata(ArrayRef<unsigned> KnownIDs) { return; } - LLVMContextImpl::MDMapTy &Info = InstructionMetadata[this]; + auto &Info = InstructionMetadata[this]; unsigned I; unsigned E; // Walk the array and drop any metadata we don't know. @@ -1045,8 +1044,7 @@ void Instruction::setMetadata(unsigned KindID, MDNode *Node) { // Handle the case when we're adding/updating metadata on an instruction. if (Node) { - LLVMContextImpl::MDMapTy &Info = - getContext().pImpl->InstructionMetadata[this]; + auto &Info = getContext().pImpl->InstructionMetadata[this]; assert(!Info.empty() == hasMetadataHashEntry() && "HasMetadata bit is wonked"); if (Info.empty()) { @@ -1072,8 +1070,7 @@ void Instruction::setMetadata(unsigned KindID, MDNode *Node) { "HasMetadata bit out of date!"); if (!hasMetadataHashEntry()) return; // Nothing to remove! - LLVMContextImpl::MDMapTy &Info = - getContext().pImpl->InstructionMetadata[this]; + auto &Info = getContext().pImpl->InstructionMetadata[this]; // Common case is removing the only entry. if (Info.size() == 1 && Info[0].first == KindID) { @@ -1106,8 +1103,7 @@ MDNode *Instruction::getMetadataImpl(unsigned KindID) const { if (!hasMetadataHashEntry()) return nullptr; - LLVMContextImpl::MDMapTy &Info = - getContext().pImpl->InstructionMetadata[this]; + auto &Info = getContext().pImpl->InstructionMetadata[this]; assert(!Info.empty() && "bit out of sync with hash table"); for (const auto &I : Info) @@ -1130,8 +1126,7 @@ void Instruction::getAllMetadataImpl( assert(hasMetadataHashEntry() && getContext().pImpl->InstructionMetadata.count(this) && "Shouldn't have called this"); - const LLVMContextImpl::MDMapTy &Info = - getContext().pImpl->InstructionMetadata.find(this)->second; + const auto &Info = getContext().pImpl->InstructionMetadata.find(this)->second; assert(!Info.empty() && "Shouldn't have called this"); Result.reserve(Result.size() + Info.size()); @@ -1149,8 +1144,7 @@ void Instruction::getAllMetadataOtherThanDebugLocImpl( assert(hasMetadataHashEntry() && getContext().pImpl->InstructionMetadata.count(this) && "Shouldn't have called this"); - const LLVMContextImpl::MDMapTy &Info = - getContext().pImpl->InstructionMetadata.find(this)->second; + const auto &Info = getContext().pImpl->InstructionMetadata.find(this)->second; assert(!Info.empty() && "Shouldn't have called this"); Result.reserve(Result.size() + Info.size()); for (auto &I : Info) |