Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Jun 6, 2025

This is made simpler by just returning the array ref instead of
the fancy range.

@arsenm arsenm requested a review from jhuber6 June 6, 2025 06:09
Copy link
Contributor Author

arsenm commented Jun 6, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm arsenm marked this pull request as ready for review June 6, 2025 06:09
@llvmbot llvmbot added the llvm:ir label Jun 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-llvm-ir

Author: Matt Arsenault (arsenm)

Changes

This is made simpler by just returning the array ref instead of
the fancy range.


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

1 Files Affected:

  • (modified) llvm/include/llvm/IR/RuntimeLibcalls.h (+1-4)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 26c085031a48a..a16c317fd8d41 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -68,10 +68,7 @@ struct RuntimeLibcallsInfo {
     return LibcallCallingConvs[Call];
   }
 
-  iterator_range<const char **> getLibcallNames() {
-    return llvm::make_range(LibcallRoutineNames,
-                            LibcallRoutineNames + RTLIB::UNKNOWN_LIBCALL);
-  }
+  ArrayRef<const char *> getLibcallNames() const { return LibcallRoutineNames; }
 
 private:
   /// Stores the name each libcall.

return llvm::make_range(LibcallRoutineNames,
LibcallRoutineNames + RTLIB::UNKNOWN_LIBCALL);
}
ArrayRef<const char *> getLibcallNames() const { return LibcallRoutineNames; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading this right, this is now going to include the entry for UNKNOWN_LIBCALL as well. Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not intentional, but it also doesn't really matter. Could drop_back, but it just appears as another null entry which uses have to tolerate anyway

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

arsenm added 2 commits June 6, 2025 22:03
This is made simpler by just returning the array ref instead of
the fancy range.
@arsenm arsenm force-pushed the users/arsenm/runtime-libcalls/fix-missing-const-getLibcallNames branch from f57d03b to 16b0b3e Compare June 6, 2025 13:16
@arsenm arsenm merged commit 94384ae into main Jun 6, 2025
7 checks passed
@arsenm arsenm deleted the users/arsenm/runtime-libcalls/fix-missing-const-getLibcallNames branch June 6, 2025 14:11
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
This is made simpler by just returning the array ref instead of
the fancy range.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants