/// CustomMDKindNames - Map to hold the metadata string to ID mapping.
StringMap<unsigned> CustomMDKindNames;
- typedef std::pair<unsigned, TrackingMDNodeRef> MDPairTy;
- typedef SmallVector<MDPairTy, 2> MDMapTy;
-
/// Collection of per-instruction metadata used in this context.
- DenseMap<const Instruction *, MDMapTy> InstructionMetadata;
+ DenseMap<const Instruction *,
+ SmallVector<std::pair<unsigned, TrackingMDNodeRef>, 2>>
+ InstructionMetadata;
/// DiscriminatorTable - This table maps file:line locations to an
/// integer representing the next DWARF path discriminator to assign to
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.
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.
// 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()) {
"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) {
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)
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());
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)