File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,13 @@ def HVXV65 : HVXV<"65", HVXV66>;
5656def HVXV62 : HVXV<" 62" , HVXV65>;
5757def HVXV60 : HVXV<" 60" , HVXV62>;
5858
59+ def HexagonPrefix : NamePrefix<" __builtin_HEXAGON_" >;
60+
5961class HexagonBuiltin <string prototype> : TargetBuiltin {
60- let Spellings = [" __builtin_HEXAGON_ " # NAME];
62+ let Spellings = [NAME];
6163 let Prototype = prototype;
6264 let Features = V5.Features;
65+ let RequiredNamePrefix = HexagonPrefix; // Adds a prefix to the name.
6366}
6467
6568class HexagonBuiltinNoPrefix <string prototype> : TargetBuiltin {
Original file line number Diff line number Diff line change @@ -216,7 +216,14 @@ static constexpr Builtin::Info BuiltinInfos[] = {
216216#include " clang/Basic/BuiltinsHexagon.inc"
217217#undef GET_BUILTIN_INFOS
218218};
219- static_assert (std::size(BuiltinInfos) == NumBuiltins);
219+
220+ static constexpr Builtin::Info PrefixedBuiltinInfos[] = {
221+ #define GET_BUILTIN_PREFIXED_INFOS
222+ #include " clang/Basic/BuiltinsHexagon.inc"
223+ #undef GET_BUILTIN_PREFIXED_INFOS
224+ };
225+ static_assert ((std::size(BuiltinInfos) + std::size(PrefixedBuiltinInfos)) ==
226+ NumBuiltins);
220227
221228bool HexagonTargetInfo::hasFeature (StringRef Feature) const {
222229 std::string VS = " hvxv" + HVXVersion;
@@ -277,5 +284,6 @@ void HexagonTargetInfo::fillValidCPUList(
277284
278285llvm::SmallVector<Builtin::InfosShard>
279286HexagonTargetInfo::getTargetBuiltins () const {
280- return {{&BuiltinStrings, BuiltinInfos}};
287+ return {{&BuiltinStrings, BuiltinInfos},
288+ {&BuiltinStrings, PrefixedBuiltinInfos, " __builtin_HEXAGON_" }};
281289}
You can’t perform that action at this time.
0 commit comments