projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f13019f
)
[IR] Call DenseMap::erase directly (NFC)
author
Kazu Hirata
<kazu@google.com>
Sun, 12 Jun 2022 17:47:06 +0000
(10:47 -0700)
committer
Kazu Hirata
<kazu@google.com>
Sun, 12 Jun 2022 17:47:06 +0000
(10:47 -0700)
We can erase an item in DenseMap without checking its membership first.
llvm/lib/IR/Globals.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/IR/Globals.cpp
b/llvm/lib/IR/Globals.cpp
index
4f53f8e
..
d2ddfd4
100644
(file)
--- a/
llvm/lib/IR/Globals.cpp
+++ b/
llvm/lib/IR/Globals.cpp
@@
-236,9
+236,7
@@
void GlobalValue::setSanitizerMetadata(const SanitizerMetadata &Meta) {
void GlobalValue::removeSanitizerMetadata() {
DenseMap<const GlobalValue *, SanitizerMetadata> &MetadataMap =
getContext().pImpl->GlobalValueSanitizerMetadata;
- auto It = MetadataMap.find(this);
- if (It != MetadataMap.end())
- MetadataMap.erase(It);
+ MetadataMap.erase(this);
HasSanitizerMetadata = false;
}