aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCExpr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC/MCExpr.h')
-rw-r--r--include/llvm/MC/MCExpr.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/include/llvm/MC/MCExpr.h b/include/llvm/MC/MCExpr.h
index 8cb6b86fd672..fb23c0114c76 100644
--- a/include/llvm/MC/MCExpr.h
+++ b/include/llvm/MC/MCExpr.h
@@ -1,9 +1,8 @@
//===- MCExpr.h - Assembly Level Expressions --------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -135,15 +134,21 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) {
//// Represent a constant integer expression.
class MCConstantExpr : public MCExpr {
int64_t Value;
+ bool PrintInHex = false;
- explicit MCConstantExpr(int64_t Value)
+ MCConstantExpr(int64_t Value)
: MCExpr(MCExpr::Constant, SMLoc()), Value(Value) {}
+ MCConstantExpr(int64_t Value, bool PrintInHex)
+ : MCExpr(MCExpr::Constant, SMLoc()), Value(Value),
+ PrintInHex(PrintInHex) {}
+
public:
/// \name Construction
/// @{
- static const MCConstantExpr *create(int64_t Value, MCContext &Ctx);
+ static const MCConstantExpr *create(int64_t Value, MCContext &Ctx,
+ bool PrintInHex = false);
/// @}
/// \name Accessors
@@ -151,6 +156,8 @@ public:
int64_t getValue() const { return Value; }
+ bool useHexFormat() const { return PrintInHex; }
+
/// @}
static bool classof(const MCExpr *E) {
@@ -285,16 +292,17 @@ public:
VK_Hexagon_IE,
VK_Hexagon_IE_GOT,
- VK_WebAssembly_FUNCTION, // Function table index, rather than virtual addr
- VK_WebAssembly_GLOBAL, // Global object index
- VK_WebAssembly_TYPEINDEX,// Type table index
- VK_WebAssembly_EVENT, // Event index
+ VK_WASM_TYPEINDEX, // Reference to a symbol's type (signature)
+ VK_WASM_MBREL, // Memory address relative to memory base
+ VK_WASM_TBREL, // Table index relative to table bare
VK_AMDGPU_GOTPCREL32_LO, // symbol@gotpcrel32@lo
VK_AMDGPU_GOTPCREL32_HI, // symbol@gotpcrel32@hi
VK_AMDGPU_REL32_LO, // symbol@rel32@lo
VK_AMDGPU_REL32_HI, // symbol@rel32@hi
VK_AMDGPU_REL64, // symbol@rel64
+ VK_AMDGPU_ABS32_LO, // symbol@abs32@lo
+ VK_AMDGPU_ABS32_HI, // symbol@abs32@hi
VK_TPREL,
VK_DTPREL