File tree 2 files changed +14
-3
lines changed
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>;
56
56
def HVXV62 : HVXV<" 62" , HVXV65>;
57
57
def HVXV60 : HVXV<" 60" , HVXV62>;
58
58
59
+ def HexagonPrefix : NamePrefix<" __builtin_HEXAGON_" >;
60
+
59
61
class HexagonBuiltin <string prototype> : TargetBuiltin {
60
- let Spellings = [" __builtin_HEXAGON_ " # NAME];
62
+ let Spellings = [NAME];
61
63
let Prototype = prototype;
62
64
let Features = V5.Features;
65
+ let RequiredNamePrefix = HexagonPrefix; // Adds a prefix to the name.
63
66
}
64
67
65
68
class HexagonBuiltinNoPrefix <string prototype> : TargetBuiltin {
Original file line number Diff line number Diff line change @@ -216,7 +216,14 @@ static constexpr Builtin::Info BuiltinInfos[] = {
216
216
#include " clang/Basic/BuiltinsHexagon.inc"
217
217
#undef GET_BUILTIN_INFOS
218
218
};
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);
220
227
221
228
bool HexagonTargetInfo::hasFeature (StringRef Feature) const {
222
229
std::string VS = " hvxv" + HVXVersion;
@@ -277,5 +284,6 @@ void HexagonTargetInfo::fillValidCPUList(
277
284
278
285
llvm::SmallVector<Builtin::InfosShard>
279
286
HexagonTargetInfo::getTargetBuiltins () const {
280
- return {{&BuiltinStrings, BuiltinInfos}};
287
+ return {{&BuiltinStrings, BuiltinInfos},
288
+ {&BuiltinStrings, PrefixedBuiltinInfos, " __builtin_HEXAGON_" }};
281
289
}
You can’t perform that action at this time.
0 commit comments