[llvm] [WebAssembly] Add WebAssembly::Specifier (PR #133116)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 20:00:36 PDT 2025


================
@@ -0,0 +1,64 @@
+//===- WebAssembly specific MC expression classes ---------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// The MCTargetExpr subclass describes a relocatable expression with a
+// WebAssembly-specific relocation specifier.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCEXPR_H
+#define LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCEXPR_H
+
+#include "llvm/MC/MCExpr.h"
+
+namespace llvm {
+
+class WebAssemblyMCExpr : public MCTargetExpr {
+public:
+  enum Specifier {
+    VK_None,
+    VK_TYPEINDEX,
+    VK_TBREL,
+    VK_MBREL,
+    VK_TLSREL,
+    VK_GOT,
+    VK_GOT_TLS,
+    VK_FUNCINDEX,
----------------
MaskRay wrote:

Agreed that we don't necessarily use `VK_`. For AArch64 Mach-O I've used `M_`.

Renamed these to `S_` for (S)pecifier.

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


More information about the llvm-commits mailing list