<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">While reviewing <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10423&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=v0E4fPHan6afrSYfNX0R9whmWOZH_1Ci5GTiI5iJNBM&s=AUtXM4EVYFX5RSkzKVdr0RObdc5szoN1rt27j67cf_g&e=" class="">http://reviews.llvm.org/D10423</a>, I ran into a problem with our _Builtin_Intrinsics module map file.  It contains a submodule for arm intrinsics:</div><div class=""><div class=""><div class=""><div class=""><br class=""></div><div class=""><div class="">  explicit module arm {</div><div class=""><b class="">    requires arm</b></div></div><div class=""><div class=""><br class=""></div></div><div class="">This doesn’t work as intended, because today only 32bit arm targets publish the “arm” target feature, but this module is supposed to be used on AArch64 as well (e.g. for the arm_neon.h header).  The target features that we can use in a module “requires” declaration are controlled by TargetInfo::hasFeature().  Only module map parsing currently checks for the arm feature.</div><div class=""><br class=""></div><div class="">I propose that we rename the current “arm” feature to “arm32” and take over the name “arm” to mean “arm32 || aarch64”.</div><div class=""><br class=""></div><div class="">Pros</div><div class="">* Mirrors the x86/x86_32/x86_64 feature names and functionality</div><div class="">* Anecdotally, this better matches user expectation of what “requires arm” means</div><div class=""><br class=""></div><div class="">Cons</div><div class="">* This is a backwards-incompatible change if any modules rely on “requires arm” failing on aarch64 targets.</div><div class=""><br class=""></div><div class="">Would this break existing modules for anyone who cannot just add a “requires !aarch64” to their module map? Or does anyone feel strongly that this is the wrong solution?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The other possibilities I considered, but felt were worse solutions:</div><div class="">(a) Keep the meaning of “arm” and invent a new feature to mean "arm || aarch64".  Mostly I felt this left the existing name unnecessarily confusing.</div><div class="">(b) accepting the state of the compiler and duplicating the “arm” submodule. In theory, isBetterKnownHeader will allow this to “just work” for #includes, but users would have to spell their @imports differently for different targets, or</div><div class="">(c) adding some general feature to spell disjunctions in module requires decls (this didn’t seem worth it since I can’t think of any other users for such a feature).</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Ben</div><div class=""><br class=""></div></div></div></div></body></html>