Skip to content

Commit 89b8293

Browse files
committed
SmallDenseMap and comment
1 parent 6de43b7 commit 89b8293

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

llvm/include/llvm/IR/ValueMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class ValueMap {
8888
using MapT = DenseMap<ValueMapCVH, ValueT, DenseMapInfo<ValueMapCVH>>;
8989
using MDMapT = DenseMap<const Metadata *, TrackingMDRef>;
9090
/// Map {(InlinedAt, old atom number) -> new atom number}.
91-
using DMAtomT = DenseMap<std::pair<Metadata *, uint64_t>, uint64_t>;
91+
using DMAtomT = SmallDenseMap<std::pair<Metadata *, uint64_t>, uint64_t>;
9292
using ExtraData = typename Config::ExtraData;
9393

9494
MapT Map;

llvm/include/llvm/Transforms/Utils/Cloning.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,13 @@ struct ClonedCodeInfo {
119119
/// function, you can specify a ClonedCodeInfo object with the optional fifth
120120
/// parameter.
121121
///
122-
/// Set \p MapAtoms to false to skip mapping source atoms for later remapping.
123-
/// Incorrectly setting false may harm the debugging experience. It's safe to
124-
/// set false if the cloned basic block is destined for a different function or
125-
/// if the original block is deleted. Setting true (default) is always safe
126-
/// (correct) but sometimes unecessary; this option reduces the compile-time
127-
/// impact of Key Instruction in such cases.
122+
/// \p MapAtoms indicates whether source location atoms should be mapped for
123+
/// later remapping. Must be true when you duplicate a code path and a source
124+
/// location is intended to appear twice in the generated instructions. Can be
125+
/// set to false if you are transplanting code from one place to another.
126+
/// Setting true (default) is always safe (won't produce incorrect debug info)
127+
/// but is sometimes unnecessary, causing extra work that could be avoided by
128+
/// setting the parameter to false.
128129
BasicBlock *CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap,
129130
const Twine &NameSuffix = "", Function *F = nullptr,
130131
ClonedCodeInfo *CodeInfo = nullptr,

0 commit comments

Comments
 (0)