[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 14 00:35:31 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"))
----------------
ranapratap55 wrote:
updated the return.
https://github.com/llvm/llvm-project/pull/83109
More information about the llvm-commits
mailing list