Skip to content

Conversation

kazutakahirata
Copy link
Contributor

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

This patch removes offsetof.  Note that we already include <cstddef>
and that <cstddef> defines offsetof.
@llvmbot
Copy link
Member

llvmbot commented Sep 16, 2025

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

Changes

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


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

1 Files Affected:

  • (modified) llvm/include/llvm/Support/AMDHSAKernelDescriptor.h (-5)
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

@kazutakahirata kazutakahirata merged commit 99a0139 into llvm:main Sep 16, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250915_Support_offsetof branch September 16, 2025 16:08
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.

4 participants