================ @@ -245,6 +246,7 @@ class DataLayout { unsigned getDefaultGlobalsAddressSpace() const { return DefaultGlobalsAddrSpace; } + unsigned getFlatAddressSpace() const { return FlatAddressSpace; } ---------------- arichardson wrote:
I don't think this is a good API - returning something that looks valid (uint32_t) but might be incorrect at runtime without forcing users to check it. Storing it as ~0 internally is fine but IMO the API should return `optional` and map ~0 to `std::nullopt`. https://github.com/llvm/llvm-project/pull/108786 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits