[llvm] [Docs][libFuzzer] Replace expired libfuzzer.info link (PR #174148)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 1 08:09:30 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-adt
Author: None (Priyanshi-dixit1)
<details>
<summary>Changes</summary>
The LibFuzzer documentation referenced an expired libfuzzer.info URL.
This PR replaces it with a maintained upstream tutorial link.
Fixes #<!-- -->165726
---
Full diff: https://github.com/llvm/llvm-project/pull/174148.diff
2 Files Affected:
- (modified) llvm/docs/LibFuzzer.rst (+2-2)
- (modified) llvm/include/llvm/ADT/DenseMap.h (+15-9)
``````````diff
diff --git a/llvm/docs/LibFuzzer.rst b/llvm/docs/LibFuzzer.rst
index 2137740896ddb..56eaab5940184 100644
--- a/llvm/docs/LibFuzzer.rst
+++ b/llvm/docs/LibFuzzer.rst
@@ -482,8 +482,8 @@ More examples
-------------
Examples of real-life fuzz targets and the bugs they find can be found
-at http://tutorial.libfuzzer.info. Among other things you can learn how
-to detect Heartbleed_ in one second.
+at https://github.com/google/fuzzing/blob/master/tutorial/libFuzzerTutorial.md.
+Among other things you can learn how to detect Heartbleed_ in one second.
Advanced features
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index fe8868619730e..081f003d28f8e 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -208,9 +208,9 @@ class DenseMapBase : public DebugEpochBase {
return ValueT();
}
- // Return the entry with the specified key, or \p Default. This variant is
- // useful, because `lookup` cannot be used with non-default-constructible
- // values.
+ /// Returns the mapped value for Val if present, otherwise Default.
+ ///
+ /// This is useful when the mapped type is not default-constructible.
template <typename U = std::remove_cv_t<ValueT>>
[[nodiscard]] ValueT lookup_or(const_arg_type_t<KeyT> Val,
U &&Default) const {
@@ -249,17 +249,14 @@ class DenseMapBase : public DebugEpochBase {
return try_emplace_impl(std::move(KV.first), std::move(KV.second));
}
- // Inserts key,value pair into the map if the key isn't already in the map.
- // The value is constructed in-place if the key is not in the map, otherwise
- // it is not moved.
+ /// Inserts a value for Key if absent, forwarding Args to construct it.
+ /// Returns an iterator to the element and whether insertion occurred.
template <typename... Ts>
std::pair<iterator, bool> try_emplace(KeyT &&Key, Ts &&...Args) {
return try_emplace_impl(std::move(Key), std::forward<Ts>(Args)...);
}
- // Inserts key,value pair into the map if the key isn't already in the map.
- // The value is constructed in-place if the key is not in the map, otherwise
- // it is not moved.
+
template <typename... Ts>
std::pair<iterator, bool> try_emplace(const KeyT &Key, Ts &&...Args) {
return try_emplace_impl(Key, std::forward<Ts>(Args)...);
@@ -295,6 +292,8 @@ class DenseMapBase : public DebugEpochBase {
insert(adl_begin(R), adl_end(R));
}
+ /// Inserts a value for Key if absent, otherwise assigns Val.
+ /// Returns an iterator to the element and whether insertion occurred.
template <typename V>
std::pair<iterator, bool> insert_or_assign(const KeyT &Key, V &&Val) {
auto Ret = try_emplace(Key, std::forward<V>(Val));
@@ -302,6 +301,7 @@ class DenseMapBase : public DebugEpochBase {
Ret.first->second = std::forward<V>(Val);
return Ret;
}
+
template <typename V>
std::pair<iterator, bool> insert_or_assign(KeyT &&Key, V &&Val) {
@@ -311,6 +311,8 @@ class DenseMapBase : public DebugEpochBase {
return Ret;
}
+ /// Inserts a value for Key if absent, otherwise assigns a newly constructed one.
+ /// Returns an iterator to the element and whether insertion occurred.
template <typename... Ts>
std::pair<iterator, bool> emplace_or_assign(const KeyT &Key, Ts &&...Args) {
auto Ret = try_emplace(Key, std::forward<Ts>(Args)...);
@@ -319,6 +321,7 @@ class DenseMapBase : public DebugEpochBase {
return Ret;
}
+
template <typename... Ts>
std::pair<iterator, bool> emplace_or_assign(KeyT &&Key, Ts &&...Args) {
auto Ret = try_emplace(std::move(Key), std::forward<Ts>(Args)...);
@@ -346,10 +349,13 @@ class DenseMapBase : public DebugEpochBase {
incrementNumTombstones();
}
+ /// Returns a reference to the mapped value for Key, inserting a
+ /// default-constructed value if necessary.
ValueT &operator[](const KeyT &Key) {
return lookupOrInsertIntoBucket(Key).first->second;
}
+
ValueT &operator[](KeyT &&Key) {
return lookupOrInsertIntoBucket(std::move(Key)).first->second;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/174148
More information about the llvm-commits
mailing list