[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
Mon Mar 11 04:28:50 PDT 2024


================
@@ -251,6 +253,22 @@ template <typename IntTy> static Error getInt(StringRef R, IntTy &Result) {
   return Error::success();
 }
 
+template <typename IntTy>
+static Error getIntForAddrSpace(StringRef R, IntTy &Result) {
+  if (R.starts_with("neg")) {
+    StringRef AfterNeg = R.slice(3, R.size());
+    bool error = AfterNeg.getAsInteger(10, Result);
+    (void)error;
+    if (error || Result <= 0)
+      return reportError("not a number, or does not fit in an unsigned int");
+    Result *= -1;
+    return Error::success();
+  } else if (R.contains("neg"))
----------------
arsenm wrote:

no else after return 

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


More information about the llvm-commits mailing list