Skip to content

[Analysis] Use a range-based for loop (NFC) #139488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 12, 2025

@llvm/pr-subscribers-backend-directx

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/139488.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/DXILResource.cpp (+1-3)
diff --git a/llvm/lib/Analysis/DXILResource.cpp b/llvm/lib/Analysis/DXILResource.cpp
index 1602b24e7d9af..baba7d2c75e58 100644
--- a/llvm/lib/Analysis/DXILResource.cpp
+++ b/llvm/lib/Analysis/DXILResource.cpp
@@ -955,9 +955,7 @@ void DXILResourceBindingInfo::populate(Module &M, DXILResourceTypeMap &DRTM) {
   // for each binding type and used spaces. Bindings are sorted by resource
   // class, space, and lower bound register slot.
   BindingSpaces *BS = &SRVSpaces;
-  for (unsigned I = 0, E = Bindings.size(); I != E; ++I) {
-    Binding &B = Bindings[I];
-
+  for (const Binding &B : Bindings) {
     if (BS->RC != B.RC)
       // move to the next resource class spaces
       BS = &getBindingSpaces(B.RC);

@kazutakahirata kazutakahirata merged commit 4c9ffb7 into llvm:main May 12, 2025
14 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_tidy_modernize-loop-convert_llvm branch May 12, 2025 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants