From 7ca14f6044bfa46efdbb4d4080e36c3265a09a78 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 18 Nov 2021 09:09:52 -0800 Subject: [llvm] Use range-based for loops (NFC) --- llvm/lib/CodeGen/StackProtector.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/StackProtector.cpp') diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index d6d49c3..7445f77 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -148,10 +148,8 @@ bool StackProtector::ContainsProtectableArray(Type *Ty, bool &IsLarge, return false; bool NeedsProtector = false; - for (StructType::element_iterator I = ST->element_begin(), - E = ST->element_end(); - I != E; ++I) - if (ContainsProtectableArray(*I, IsLarge, Strong, true)) { + for (Type *ET : ST->elements()) + if (ContainsProtectableArray(ET, IsLarge, Strong, true)) { // If the element is a protectable array and is large (>= SSPBufferSize) // then we are done. If the protectable array is not large, then // keep looking in case a subsequent element is a large array. -- cgit v1.1