aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/StackProtector.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-11-18 09:09:52 -0800
committerKazu Hirata <kazu@google.com>2021-11-18 09:09:52 -0800
commit7ca14f6044bfa46efdbb4d4080e36c3265a09a78 (patch)
tree6fc08bc40f8f67dc5fd74e71109edd1d0bf764e7 /llvm/lib/CodeGen/StackProtector.cpp
parent7796d81ae8204289c6ea07f19e538cf287d3213f (diff)
downloadllvm-7ca14f6044bfa46efdbb4d4080e36c3265a09a78.zip
llvm-7ca14f6044bfa46efdbb4d4080e36c3265a09a78.tar.gz
llvm-7ca14f6044bfa46efdbb4d4080e36c3265a09a78.tar.bz2
[llvm] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r--llvm/lib/CodeGen/StackProtector.cpp6
1 files changed, 2 insertions, 4 deletions
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.