Skip to content

Commit 35dd889

Browse files
[llvm] Use llvm::iterator_range::empty (NFC) (#151905)
1 parent 39ca925 commit 35dd889

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

llvm/lib/DebugInfo/DWARF/DWARFContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,7 @@ class DWARFObjInMemory final : public DWARFObject {
22602260
continue;
22612261
}
22622262

2263-
if (Section.relocation_begin() == Section.relocation_end())
2263+
if (Section.relocations().empty())
22642264
continue;
22652265

22662266
// Symbol to [address, section index] cache mapping.

llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class MachOLinkGraphBuilder_arm64 : public MachOLinkGraphBuilder {
261261

262262
// Skip relocations virtual sections.
263263
if (S.isVirtual()) {
264-
if (S.relocation_begin() != S.relocation_end())
264+
if (!S.relocations().empty())
265265
return make_error<JITLinkError>("Virtual section contains "
266266
"relocations");
267267
continue;

llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class MachOLinkGraphBuilder_x86_64 : public MachOLinkGraphBuilder {
236236

237237
// Skip relocations virtual sections.
238238
if (S.isVirtual()) {
239-
if (S.relocation_begin() != S.relocation_end())
239+
if (!S.relocations().empty())
240240
return make_error<JITLinkError>("Virtual section contains "
241241
"relocations");
242242
continue;

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2822,7 +2822,7 @@ Error RuntimeDyldELF::finalizeLoad(const ObjectFile &Obj,
28222822
// object's sections to GOTs.
28232823
for (section_iterator SI = Obj.section_begin(), SE = Obj.section_end();
28242824
SI != SE; ++SI) {
2825-
if (SI->relocation_begin() != SI->relocation_end()) {
2825+
if (!SI->relocations().empty()) {
28262826
Expected<section_iterator> RelSecOrErr = SI->getRelocatedSection();
28272827
if (!RelSecOrErr)
28282828
return make_error<RuntimeDyldError>(

llvm/lib/SandboxIR/Value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Value::Value(ClassID SubclassID, llvm::Value *Val, Context &Ctx)
2222

2323
Value::use_iterator Value::use_begin() {
2424
llvm::Use *LLVMUse = nullptr;
25-
if (Val->use_begin() != Val->use_end())
25+
if (!Val->uses().empty())
2626
LLVMUse = &*Val->use_begin();
2727
User *User = LLVMUse != nullptr ? cast_or_null<sandboxir::User>(Ctx.getValue(
2828
Val->use_begin()->getUser()))

llvm/lib/Target/DirectX/DXContainerGlobals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ GlobalVariable *DXContainerGlobals::computeShaderHash(Module &M) {
103103
dxbc::ShaderHash HashData = {0, {0}};
104104
// The Hash's IncludesSource flag gets set whenever the hashed shader includes
105105
// debug information.
106-
if (M.debug_compile_units_begin() != M.debug_compile_units_end())
106+
if (!M.debug_compile_units().empty())
107107
HashData.Flags = static_cast<uint32_t>(dxbc::HashFlags::IncludesSource);
108108

109109
memcpy(reinterpret_cast<void *>(&HashData.Digest), Result.data(), 16);

llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ bool HexagonCommonGEP::isHandledGepForm(GetElementPtrInst *GepI) {
330330
if (!GepI->getType()->isPointerTy())
331331
return false;
332332
// No GEPs without any indices. (Is this possible?)
333-
if (GepI->idx_begin() == GepI->idx_end())
333+
if (GepI->indices().empty())
334334
return false;
335335
return true;
336336
}

llvm/lib/Transforms/Utils/PredicateInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ PredicateInfo::~PredicateInfo() {
721721
CreatedDeclarations.clear();
722722

723723
for (Function *F : FunctionPtrs) {
724-
assert(F->user_begin() == F->user_end() &&
724+
assert(F->users().empty() &&
725725
"PredicateInfo consumer did not remove all SSA copies.");
726726
F->eraseFromParent();
727727
}

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ void Dumper::printRelocations() {
27362736
for (const SectionRef &Section : ToolSectionFilter(O, &Ndx)) {
27372737
if (O.isELF() && (ELFSectionRef(Section).getFlags() & ELF::SHF_ALLOC))
27382738
continue;
2739-
if (Section.relocation_begin() == Section.relocation_end())
2739+
if (Section.relocations().empty())
27402740
continue;
27412741
Expected<section_iterator> SecOrErr = Section.getRelocatedSection();
27422742
if (!SecOrErr)

0 commit comments

Comments
 (0)