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

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 03:02:05 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");
----------------
Pierre-vh wrote:

```suggestion
      if (Rest.empty()) {
        return reportError(
            "Missing address space specification for pointer in datalayout string");
      }
```

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


More information about the llvm-commits mailing list