-
Notifications
You must be signed in to change notification settings - Fork 15k
Fix llvm::StripTemplateParameters to not return an empty name. #157553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
b31cccc
6d612bd
be50148
8442dfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -299,4 +299,18 @@ TEST(DWARFDebugNames, UnsupportedForm) { | |
| Sections, | ||
| FailedWithMessage("unsupported Form for YAML debug_names emitter")); | ||
| } | ||
|
|
||
| TEST(DWARFDebugNames, TestStripTemplateParameters) { | ||
|
|
||
| std::optional<StringRef> stripped_name; | ||
| // Make sure we can extract the name "foo" from the template parameters. | ||
| stripped_name = StripTemplateParameters("foo<int>"); | ||
| ASSERT_TRUE(stripped_name.has_value()); | ||
| ASSERT_EQ(*stripped_name, StringRef("foo")); | ||
| // Make sure that we don't get an empty name back when the string starts with | ||
|
||
| // '<'. | ||
| stripped_name = StripTemplateParameters("<int>"); | ||
| ASSERT_FALSE(stripped_name.has_value()); | ||
| } | ||
|
|
||
| } // end anonymous namespace | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this
Name.starts_with("<")check anymore right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. I can remove it.