[clang] [Serialization] Remove an unnecessarycast (NFC) (PR #147204)
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/147204 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Serialization] Remove an unnecessarycast (NFC) (PR #147204)
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/147204 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Serialization] Remove an unnecessarycast (NFC) (PR #147204)
llvmbot wrote:
@llvm/pr-subscribers-clang-modules
Author: Kazu Hirata (kazutakahirata)
Changes
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(ID >> 1);
assert(IndexFromEnd && "got reference to unknown module file");
-return
getModuleManager().pch_modules().end()[-static_cast(IndexFromEnd)];
+return getModuleManager().pch_modules().end()[-IndexFromEnd];
}
}
``
https://github.com/llvm/llvm-project/pull/147204
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Serialization] Remove an unnecessarycast (NFC) (PR #147204)
https://github.com/kazutakahirata created
https://github.com/llvm/llvm-project/pull/147204
IndexFromEnd is already of int.
>From bf416ae0d374a15107b8e742660bd985a7d9b2d8 Mon Sep 17 00:00:00 2001
From: Kazu Hirata
Date: Sat, 5 Jul 2025 17:57:13 -0700
Subject: [PATCH] [Serialization] Remove an unnecessarycast (NFC)
IndexFromEnd is already of int.
---
clang/lib/Serialization/ASTReader.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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(ID >> 1);
assert(IndexFromEnd && "got reference to unknown module file");
-return
getModuleManager().pch_modules().end()[-static_cast(IndexFromEnd)];
+return getModuleManager().pch_modules().end()[-IndexFromEnd];
}
}
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
