[compiler-rt] db0f427 - [compiler-rt][nsan] Remove unused checkValueConsistency template (NFC) (#207441)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 3 22:58:04 PDT 2026
Author: Aditya Medhane
Date: 2026-07-04T08:57:59+03:00
New Revision: db0f427a25a4caae97679a4a0caf05aed5dd47f5
URL: https://github.com/llvm/llvm-project/commit/db0f427a25a4caae97679a4a0caf05aed5dd47f5
DIFF: https://github.com/llvm/llvm-project/commit/db0f427a25a4caae97679a4a0caf05aed5dd47f5.diff
LOG: [compiler-rt][nsan] Remove unused checkValueConsistency template (NFC) (#207441)
checkValueConsistency is a static function template in nsan.cpp with no
callers, so it trips -Wunused-template. Remove the dead code.
Part of #202945
Added:
Modified:
compiler-rt/lib/nsan/nsan.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/nsan/nsan.cpp b/compiler-rt/lib/nsan/nsan.cpp
index 1c06340549aca..a05c84b09547d 100644
--- a/compiler-rt/lib/nsan/nsan.cpp
+++ b/compiler-rt/lib/nsan/nsan.cpp
@@ -328,21 +328,6 @@ static ValueType getValueType(u8 c) { return static_cast<ValueType>(c & 0x3); }
static int getValuePos(u8 c) { return c >> kValueSizeSizeBits; }
-// Checks the consistency of the value types at the given type pointer.
-// If the value is inconsistent, returns ValueType::kUnknown. Else, return the
-// consistent type.
-template <typename FT>
-static bool checkValueConsistency(const u8 *shadow_type) {
- const int pos = getValuePos(*shadow_type);
- // Check that all bytes from the start of the value are ordered.
- for (uptr i = 0; i < sizeof(FT); ++i) {
- const u8 T = *(shadow_type - pos + i);
- if (!(getValueType(T) == FTInfo<FT>::kValueType && getValuePos(T) == i))
- return false;
- }
- return true;
-}
-
// The instrumentation automatically appends `shadow_value_type_ids`, see
// maybeAddSuffixForNsanInterface.
extern "C" SANITIZER_INTERFACE_ATTRIBUTE void
More information about the llvm-commits
mailing list