[llvm] [llubi] Add initial support for llubi (PR #180022)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 6 07:34:06 PST 2026


================
@@ -0,0 +1,139 @@
+//===--- Value.h - Value Representation for llubi ---------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLUBI_VALUE_H
+#define LLVM_TOOLS_LLUBI_VALUE_H
+
+#include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/APInt.h"
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/IR/Type.h"
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvm::ubi {
+
+class MemoryObject;
+class Context;
+class AnyValue;
+
+enum class ByteKind : uint8_t {
+  Concrete,
+  Undef,
+  Poison,
+};
+
+struct Byte {
+  uint8_t Value;
+  ByteKind Kind : 2;
+  // TODO: provenance
+
+  void Set(uint8_t V) {
+    Value = V;
+    Kind = ByteKind::Concrete;
+  }
+};
+
+// TODO: Byte
+enum class StorageKind {
+  Integer,
+  Float,
+  Pointer,
+  Poison,
+  None,      // Placeholder for void type
+  Aggregate, // Struct, Array or Vector
+};
+
+class Pointer {
+  mutable IntrusiveRefCntPtr<MemoryObject> Obj;
+  APInt Address;
+  uint64_t Offset;
+  uint64_t Bound;
----------------
dtcxzyw wrote:

Done.

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


More information about the llvm-commits mailing list