Skip to content

Commit d5e274f

Browse files
committed
[NFC] SWDEV-517818 - Switch back static_assert to assert to ensure compatibility with older compiler
1 parent 3035dd8 commit d5e274f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

llvm/include/llvm/Support/TypeName.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ inline LLVM_GET_TYPE_NAME_CONSTEXPR StringRef getTypeName() {
7171
LLVM_GET_TYPE_NAME_CONSTEXPR std::string_view Key = "getTypeName<";
7272
LLVM_GET_TYPE_NAME_CONSTEXPR std::string_view GetTypeNameStart =
7373
Name.substr(Name.find(Key));
74-
static_assert(!GetTypeNameStart.empty(),
75-
"Unable to find the template parameter!");
74+
// TODO: SWDEV-517818 - Changed from static_assert to assert to ensure
75+
// compiler compatibility
76+
assert(!GetTypeNameStart.empty() && "Unable to find the template parameter!");
7677
LLVM_GET_TYPE_NAME_CONSTEXPR std::string_view SubstitutionKey =
7778
GetTypeNameStart.substr(Key.size());
7879

@@ -95,8 +96,10 @@ inline LLVM_GET_TYPE_NAME_CONSTEXPR StringRef getTypeName() {
9596
: RmPrefixUnion;
9697

9798
LLVM_GET_TYPE_NAME_CONSTEXPR auto AnglePos = RmPrefixEnum.rfind('>');
98-
static_assert(AnglePos != std::string_view::npos,
99-
"Unable to find the closing '>'!");
99+
// TODO: SWDEV-517818 - Changed from static_assert to assert to ensure
100+
// compiler compatibility
101+
assert(AnglePos != std::string_view::npos &&
102+
"Unable to find the closing '>'!");
100103
return RmPrefixEnum.substr(0, AnglePos);
101104
#else
102105
// No known technique for statically extracting a type name on this compiler.

0 commit comments

Comments
 (0)