[llvm] [DataLayout] Add byte specification (PR #106536)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Mon May 4 06:44:47 PDT 2026
================
@@ -357,6 +357,36 @@ static Error parseAlignment(StringRef Str, Align &Alignment, StringRef Name,
return Error::success();
}
+Error DataLayout::parseByteSpec(StringRef Spec) {
+ // b:<size>
+ assert(Spec.front() == 'b');
+ StringRef Rest = Spec.drop_front();
+ if (!Rest.consume_front(":") || Rest.empty())
+ return createSpecFormatError("b:<size>");
+
+ if (Error Err = parseSize(Rest, ByteWidth))
+ return Err;
+
+ if (ByteWidth != 8 && ByteWidth != 16 && ByteWidth != 32)
+ return createStringError("unsupported byte width");
----------------
s-barannikov wrote:
Yeah, looks like I forgot to include tests in this PR.
I promised a dedicated RFC for these changes, but can't find time to do this. For now, I'm just trying to keep the set of patches synced with upstream in case someone wants to use it. You can hit the unsubscribe button until then if the updates spam too much.
https://github.com/llvm/llvm-project/pull/106536
More information about the llvm-commits
mailing list