Skip to content

[clang-doc][NFC] Use isa<> over dyn_cast #136445

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

Merged
merged 1 commit into from
Apr 22, 2025
Merged

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Apr 19, 2025

No description provided.

Copy link
Contributor Author

ilovepi commented Apr 19, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Apr 19, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Paul Kirth (ilovepi)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/136445.diff

1 Files Affected:

  • (modified) clang-tools-extra/clang-doc/Serialize.cpp (+2-2)
diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index 1dcccf3c3c2ab..bc31621f4a92e 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -246,9 +246,9 @@ static TypeInfo getTypeInfoForType(const QualType &T,
     return TypeInfo(Reference(SymbolID(), T.getAsString(Policy)));
 
   InfoType IT;
-  if (dyn_cast<EnumDecl>(TD)) {
+  if (isa<EnumDecl>(TD)) {
     IT = InfoType::IT_enum;
-  } else if (dyn_cast<RecordDecl>(TD)) {
+  } else if (isa<RecordDecl>(TD)) {
     IT = InfoType::IT_record;
   } else {
     IT = InfoType::IT_default;

Copy link
Contributor Author

ilovepi commented Apr 22, 2025

Merge activity

  • Apr 22, 3:22 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 22, 3:23 PM EDT: A user merged this pull request with Graphite.

@ilovepi ilovepi merged commit 11d5c4d into main Apr 22, 2025
13 checks passed
@ilovepi ilovepi deleted the users/ilovepi/clang-doc-tidy-isa branch April 22, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants