[llvm] TargetLibraryInfo: Use pointer index size to determine getSizeTSize(). (PR #118747)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 02:00:05 PST 2024


================
@@ -249,6 +250,12 @@ class TargetLibraryInfoImpl {
   /// Returns the size of the size_t type in bits.
   unsigned getSizeTSize(const Module &M) const;
 
+  /// Returns an IntegerType corresponding to size_t.
+  IntegerType *getSizeTType(const Module &M) const;
+
+  /// Returns a constant materialized as a size_t type.
+  ConstantInt *getAsSizeT(uint64_t V, const Module &M) const;
----------------
nikic wrote:

I don't think adding these to Impl is necessary, you can directly define these on TargetLibraryInfo (by calling Impl->getSizeTSize).

https://github.com/llvm/llvm-project/pull/118747


More information about the llvm-commits mailing list