[clang] [Clang][AMDGPU] Handle builtin types more generically. NFC. (PR #109004)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 09:02:16 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jay Foad (jayfoad)

<details>
<summary>Changes</summary>

Tweak encodeTypeForFunctionPointerAuth to handle all AMDGPU builtin
types generically instead of just __amdgpu_buffer_rsrc_t which happens
to be the only one defined so far.


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


1 Files Affected:

- (modified) clang/lib/AST/ASTContext.cpp (+2-1) 


``````````diff
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 67841a30a571f3..ebd4a41ee6367a 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3377,7 +3377,8 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext &Ctx,
 #include "clang/Basic/HLSLIntangibleTypes.def"
     case BuiltinType::Dependent:
       llvm_unreachable("should never get here");
-    case BuiltinType::AMDGPUBufferRsrc:
+#define AMDGPU_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
+#include "clang/Basic/AMDGPUTypes.def"
     case BuiltinType::WasmExternRef:
 #define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
 #include "clang/Basic/RISCVVTypes.def"

``````````

</details>


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


More information about the cfe-commits mailing list