[llvm-branch-commits] [llvm] [DataLayout][LangRef] Split non-integral and unstable pointer properties (PR #105735)
Jessica Clarke via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Oct 25 10:44:30 PDT 2024
================
@@ -419,9 +420,24 @@ Error DataLayout::parsePointerSpec(StringRef Spec) {
// Address space. Optional, defaults to 0.
unsigned AddrSpace = 0;
- if (!Components[0].empty())
- if (Error Err = parseAddrSpace(Components[0], AddrSpace))
+ bool UnstableRepr = false;
+ bool NonIntegralRepr = false;
+ StringRef AddrSpaceStr = Components[0].drop_while([&](char C) {
+ if (C == 'n') {
+ NonIntegralRepr = true;
+ return true;
+ } else if (C == 'u') {
+ UnstableRepr = true;
+ return true;
+ }
+ return false;
+ });
+ if (!AddrSpaceStr.empty()) {
+ if (Error Err = parseAddrSpace(AddrSpaceStr, AddrSpace))
return Err;
+ }
+ if (AddrSpace == 0 && (NonIntegralRepr || UnstableRepr))
+ return createStringError("address space 0 cannot be non-integral");
----------------
jrtc27 wrote:
The check is for non-integral or unstable, but this only mentions the former
https://github.com/llvm/llvm-project/pull/105735
More information about the llvm-branch-commits
mailing list