mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-28 14:46:39 +00:00
Use assertion instead of early exit to catch malformed custom metadata store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9dddf97480
commit
1d957e4d0d
@ -351,15 +351,14 @@ const StringMap<unsigned> *MetadataContext::getHandlerNames() {
|
||||
void MetadataContext::ValueIsDeleted(const Instruction *Inst) {
|
||||
// Find Metadata handles for this instruction.
|
||||
MDStoreTy::iterator I = MetadataStore.find(Inst);
|
||||
if (I == MetadataStore.end())
|
||||
return;
|
||||
assert (I != MetadataStore.end() && "Invalid custom metadata info!");
|
||||
MDMapTy &Info = I->second;
|
||||
|
||||
// FIXME : Give all metadata handlers a chance to adjust.
|
||||
|
||||
// Remove the entries for this instruction.
|
||||
Info.clear();
|
||||
MetadataStore.erase(Inst);
|
||||
MetadataStore.erase(I);
|
||||
}
|
||||
|
||||
/// ValueIsCloned - This handler is used to update metadata store
|
||||
@ -367,8 +366,7 @@ void MetadataContext::ValueIsDeleted(const Instruction *Inst) {
|
||||
void MetadataContext::ValueIsCloned(const Instruction *In1, Instruction *In2) {
|
||||
// Find Metadata handles for In1.
|
||||
MDStoreTy::iterator I = MetadataStore.find(In1);
|
||||
if (I == MetadataStore.end())
|
||||
return;
|
||||
assert (I != MetadataStore.end() && "Invalid custom metadata info!");
|
||||
|
||||
// FIXME : Give all metadata handlers a chance to adjust.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user