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

Rana Pratap Reddy via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 10:00:19 PST 2024


================
@@ -502,6 +513,31 @@ Error DataLayout::parseSpecifier(StringRef Desc) {
         return Err;
       break;
     }
+    case 'z': {
+      unsigned 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;
+      int64_t Value;
+      if (Error Err = getIntForAddrSpace(Tok, Value))
+        return Err;
+
+      // for default address space e.g., z:0
+      if (AddrSpace == 0) {
----------------
ranapratap55 wrote:

updated the default address space handling.

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


More information about the llvm-commits mailing list