[llvm] [WIP] Extend data layout to add non zero null value for address space. (PR #83109)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 08:37:17 PST 2024


================
@@ -502,6 +502,27 @@ Error DataLayout::parseSpecifier(StringRef Desc) {
         return Err;
       break;
     }
+    case 'z': {
+      uint64_t AddrSpace = 0;
+      if (!Tok.empty())
+        if (Error Err = getInt(Tok, AddrSpace))
+          return Err;
+      if (!isUInt<24>(AddrSpace))
+        return reportError("Invalid address space, must be a 24-bit integer");
+
+      if (Rest.empty())
+        return reportError(
+            "Missing address space specification for pointer in datalayout string");
+      if (Error Err = ::split(Rest, ':', Split))
+        return Err;
+      uint64_t Value;
----------------
arsenm wrote:

Needs assembler tests for signed/unsigned handling. We want -1 which is awkward given the task separated syntax of the data layout. For the concrete use, maybe we can get away with some named value? 

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


More information about the llvm-commits mailing list