Rename `MetadataStore` to the more explicit `InstructionMetadata`. This
will make room for `FunctionMetadata` (start of PR23340).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235763
91177308-0d34-0410-b5e6-
96231b3b80d8
typedef std::pair<unsigned, TrackingMDNodeRef> MDPairTy;
typedef SmallVector<MDPairTy, 2> MDMapTy;
typedef std::pair<unsigned, TrackingMDNodeRef> MDPairTy;
typedef SmallVector<MDPairTy, 2> MDMapTy;
- /// MetadataStore - Collection of per-instruction metadata used in this
- /// context.
- DenseMap<const Instruction *, MDMapTy> MetadataStore;
-
+ /// Collection of per-instruction metadata used in this context.
+ DenseMap<const Instruction *, MDMapTy> InstructionMetadata;
+
/// DiscriminatorTable - This table maps file:line locations to an
/// integer representing the next DWARF path discriminator to assign to
/// instructions in different blocks at the same location.
/// DiscriminatorTable - This table maps file:line locations to an
/// integer representing the next DWARF path discriminator to assign to
/// instructions in different blocks at the same location.
if (!hasMetadataHashEntry())
return; // Nothing to remove!
if (!hasMetadataHashEntry())
return; // Nothing to remove!
- DenseMap<const Instruction *, LLVMContextImpl::MDMapTy> &MetadataStore =
- getContext().pImpl->MetadataStore;
+ DenseMap<const Instruction *, LLVMContextImpl::MDMapTy> &InstructionMetadata =
+ getContext().pImpl->InstructionMetadata;
if (KnownSet.empty()) {
// Just drop our entry at the store.
if (KnownSet.empty()) {
// Just drop our entry at the store.
- MetadataStore.erase(this);
+ InstructionMetadata.erase(this);
setHasMetadataHashEntry(false);
return;
}
setHasMetadataHashEntry(false);
return;
}
- LLVMContextImpl::MDMapTy &Info = MetadataStore[this];
+ LLVMContextImpl::MDMapTy &Info = InstructionMetadata[this];
unsigned I;
unsigned E;
// Walk the array and drop any metadata we don't know.
unsigned I;
unsigned E;
// Walk the array and drop any metadata we don't know.
if (E == 0) {
// Drop our entry at the store.
if (E == 0) {
// Drop our entry at the store.
- MetadataStore.erase(this);
+ InstructionMetadata.erase(this);
setHasMetadataHashEntry(false);
}
}
setHasMetadataHashEntry(false);
}
}
// Handle the case when we're adding/updating metadata on an instruction.
if (Node) {
// Handle the case when we're adding/updating metadata on an instruction.
if (Node) {
- LLVMContextImpl::MDMapTy &Info = getContext().pImpl->MetadataStore[this];
+ LLVMContextImpl::MDMapTy &Info =
+ getContext().pImpl->InstructionMetadata[this];
assert(!Info.empty() == hasMetadataHashEntry() &&
"HasMetadata bit is wonked");
if (Info.empty()) {
assert(!Info.empty() == hasMetadataHashEntry() &&
"HasMetadata bit is wonked");
if (Info.empty()) {
// Otherwise, we're removing metadata from an instruction.
assert((hasMetadataHashEntry() ==
// Otherwise, we're removing metadata from an instruction.
assert((hasMetadataHashEntry() ==
- (getContext().pImpl->MetadataStore.count(this) > 0)) &&
+ (getContext().pImpl->InstructionMetadata.count(this) > 0)) &&
"HasMetadata bit out of date!");
if (!hasMetadataHashEntry())
return; // Nothing to remove!
"HasMetadata bit out of date!");
if (!hasMetadataHashEntry())
return; // Nothing to remove!
- LLVMContextImpl::MDMapTy &Info = getContext().pImpl->MetadataStore[this];
+ LLVMContextImpl::MDMapTy &Info =
+ getContext().pImpl->InstructionMetadata[this];
// Common case is removing the only entry.
if (Info.size() == 1 && Info[0].first == KindID) {
// Common case is removing the only entry.
if (Info.size() == 1 && Info[0].first == KindID) {
- getContext().pImpl->MetadataStore.erase(this);
+ getContext().pImpl->InstructionMetadata.erase(this);
setHasMetadataHashEntry(false);
return;
}
setHasMetadataHashEntry(false);
return;
}
return DbgLoc.getAsMDNode();
if (!hasMetadataHashEntry()) return nullptr;
return DbgLoc.getAsMDNode();
if (!hasMetadataHashEntry()) return nullptr;
-
- LLVMContextImpl::MDMapTy &Info = getContext().pImpl->MetadataStore[this];
+
+ LLVMContextImpl::MDMapTy &Info =
+ getContext().pImpl->InstructionMetadata[this];
assert(!Info.empty() && "bit out of sync with hash table");
for (const auto &I : Info)
assert(!Info.empty() && "bit out of sync with hash table");
for (const auto &I : Info)
std::make_pair((unsigned)LLVMContext::MD_dbg, DbgLoc.getAsMDNode()));
if (!hasMetadataHashEntry()) return;
}
std::make_pair((unsigned)LLVMContext::MD_dbg, DbgLoc.getAsMDNode()));
if (!hasMetadataHashEntry()) return;
}
assert(hasMetadataHashEntry() &&
assert(hasMetadataHashEntry() &&
- getContext().pImpl->MetadataStore.count(this) &&
+ getContext().pImpl->InstructionMetadata.count(this) &&
"Shouldn't have called this");
const LLVMContextImpl::MDMapTy &Info =
"Shouldn't have called this");
const LLVMContextImpl::MDMapTy &Info =
- getContext().pImpl->MetadataStore.find(this)->second;
+ getContext().pImpl->InstructionMetadata.find(this)->second;
assert(!Info.empty() && "Shouldn't have called this");
Result.reserve(Result.size() + Info.size());
assert(!Info.empty() && "Shouldn't have called this");
Result.reserve(Result.size() + Info.size());
SmallVectorImpl<std::pair<unsigned, MDNode *>> &Result) const {
Result.clear();
assert(hasMetadataHashEntry() &&
SmallVectorImpl<std::pair<unsigned, MDNode *>> &Result) const {
Result.clear();
assert(hasMetadataHashEntry() &&
- getContext().pImpl->MetadataStore.count(this) &&
+ getContext().pImpl->InstructionMetadata.count(this) &&
"Shouldn't have called this");
const LLVMContextImpl::MDMapTy &Info =
"Shouldn't have called this");
const LLVMContextImpl::MDMapTy &Info =
- getContext().pImpl->MetadataStore.find(this)->second;
+ getContext().pImpl->InstructionMetadata.find(this)->second;
assert(!Info.empty() && "Shouldn't have called this");
Result.reserve(Result.size() + Info.size());
for (auto &I : Info)
assert(!Info.empty() && "Shouldn't have called this");
Result.reserve(Result.size() + Info.size());
for (auto &I : Info)
/// this instruction.
void Instruction::clearMetadataHashEntries() {
assert(hasMetadataHashEntry() && "Caller should check");
/// this instruction.
void Instruction::clearMetadataHashEntries() {
assert(hasMetadataHashEntry() && "Caller should check");
- getContext().pImpl->MetadataStore.erase(this);
+ getContext().pImpl->InstructionMetadata.erase(this);
setHasMetadataHashEntry(false);
}
setHasMetadataHashEntry(false);
}