Skip to content

Commit f78d74f

Browse files
[llvm] Use llvm::fill (NFC) (#147099)
We can pass a range to llvm::fill.
1 parent 57cb926 commit f78d74f

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

llvm/include/llvm/IR/LegacyPassManagers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ class LLVM_ABI PMDataManager {
333333
/// Initialize available analysis information.
334334
void initializeAnalysisInfo() {
335335
AvailableAnalysis.clear();
336-
for (auto &IA : InheritedAnalysis)
337-
IA = nullptr;
336+
llvm::fill(InheritedAnalysis, nullptr);
338337
}
339338

340339
// Return true if P preserves high level analysis used by other

llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ void CompileUnit::maybeResetToLoadedStage() {
101101
OutUnitDIE = nullptr;
102102
DebugAddrIndexMap.clear();
103103

104-
for (uint64_t &Offset : OutDieOffsetArray)
105-
Offset = 0;
106-
for (TypeEntry *&Name : TypeEntries)
107-
Name = nullptr;
104+
llvm::fill(OutDieOffsetArray, 0);
105+
llvm::fill(TypeEntries, nullptr);
108106
eraseSections();
109107

110108
setStage(Stage::CreatedNotLoaded);

llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ namespace {
105105
};
106106

107107
LatticeCell() : Kind(Top), Size(0), IsSpecial(false) {
108-
for (const Constant *&Value : Values)
109-
Value = nullptr;
108+
llvm::fill(Values, nullptr);
110109
}
111110

112111
bool meet(const LatticeCell &L);

0 commit comments

Comments
 (0)