arsenm wrote:
> I think `BoundArch("")` should behave the same as no bound arch. Right now it
> has an empty `ArchName` but `Arch == Unknown`, so `BA.empty()` is true while
> `if (BA)` is also true. Several call sites use these checks as if they both
> mean “has an arch”, e.g. HIP bundling uses both forms in the same block.
> Could we make the StringRef constructor keep empty names as
> `OffloadArch::Unused`, or make `operator bool()` check `!ArchName.empty()`?
I think using an explicit empty string should be illegal. I originally had
operator bool() check the name, but decided semantically the string shouldn't
matter. Really the string is just there for the CPU case where the target names
all don't have a corresponding OffloadArch
https://github.com/llvm/llvm-project/pull/204863
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits