[llvm] 99a0139 - [Support] Remove offsetof in AMDHSAKernelDescriptor.h (#158786)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 09:07:40 PDT 2025


Author: Kazu Hirata
Date: 2025-09-16T09:07:36-07:00
New Revision: 99a0139e28f7c69583684efb1907451fc9d0b0bf

URL: https://github.com/llvm/llvm-project/commit/99a0139e28f7c69583684efb1907451fc9d0b0bf
DIFF: https://github.com/llvm/llvm-project/commit/99a0139e28f7c69583684efb1907451fc9d0b0bf.diff

LOG: [Support] Remove offsetof in AMDHSAKernelDescriptor.h (#158786)

This patch removes offsetof.  Note that we already include <cstddef>
and that <cstddef> defines offsetof.

Added: 
    

Modified: 
    llvm/include/llvm/Support/AMDHSAKernelDescriptor.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h b/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h
index 418d2b36114c5..3f966acdf12af 100644
--- a/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h
+++ b/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h
@@ -25,11 +25,6 @@
 #include <cstddef>
 #include <cstdint>
 
-// Gets offset of specified member in specified type.
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE*)0)->MEMBER)
-#endif // offsetof
-
 // Creates enumeration entries used for packing bits into integers. Enumeration
 // entries include bit shift amount, bit width, and bit mask.
 #ifndef AMDHSA_BITS_ENUM_ENTRY


        


More information about the llvm-commits mailing list