[llvm-branch-commits] [clang-doc][NFC] Use isa over dyn_cast (PR #120309)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 17 13:59:42 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-tools-extra
Author: Paul Kirth (ilovepi)
<details>
<summary>Changes</summary>
These call sites don't need the cast, as they don't use the value.
---
Full diff: https://github.com/llvm/llvm-project/pull/120309.diff
1 Files Affected:
- (modified) clang-tools-extra/clang-doc/Serialize.cpp (+2-2)
``````````diff
diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index b9db78cf7d688f..34b9121d3154ed 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -242,9 +242,9 @@ TypeInfo getTypeInfoForType(const QualType &T) {
return TypeInfo(Reference(SymbolID(), T.getAsString()));
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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/120309
More information about the llvm-branch-commits
mailing list