Repository navigation
[compiler-rt][nsan] Remove unused checkValueConsistency template (NFC) - #207441
Merged
Merged
Conversation
checkValueConsistency is a static function template in nsan.cpp with no
callers, so it trips -Wunused-template. Remove the dead code. Part of llvm#202945
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Aditya Medhane (flash1729) ChangescheckValueConsistency is a static function template in nsan.cpp with no callers, so it trips -Wunused-template. Remove the dead code. Part of #202945 1 Files Affected:
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
|
Member
Author
|
cc @vgvassilev @alexander-shaposhnikov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
checkValueConsistency is a static function template in nsan.cpp with no callers, so it trips -Wunused-template. Remove the dead code.
Part of #202945