[clang] [Serialization] Remove an unnecessarycast (NFC) (PR #147204)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 6 10:59:18 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-modules
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
IndexFromEnd is already of int.
---
Full diff: https://github.com/llvm/llvm-project/pull/147204.diff
1 Files Affected:
- (modified) clang/lib/Serialization/ASTReader.cpp (+1-1)
``````````diff
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 6e03de87e587d..cc2d2ea86ccb7 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -9682,7 +9682,7 @@ ModuleFile *ASTReader::getLocalModuleFile(ModuleFile &M, unsigned ID) const {
// It's a prefix (preamble, PCH, ...). Look it up by index.
int IndexFromEnd = static_cast<int>(ID >> 1);
assert(IndexFromEnd && "got reference to unknown module file");
- return getModuleManager().pch_modules().end()[-static_cast<int>(IndexFromEnd)];
+ return getModuleManager().pch_modules().end()[-IndexFromEnd];
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/147204
More information about the cfe-commits
mailing list