summaryrefslogtreecommitdiff
path: root/Source/cmDefinitions.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-29 16:45:43 -0400
committerBrad King <brad.king@kitware.com>2020-06-29 17:23:27 -0400
commitdf6b077625f86e4ec0d534f6cd88f8610c5b8f8a (patch)
treec2aa4271583dcad49c08570f90f8caf2b97c8451 /Source/cmDefinitions.cxx
parentf2b84d24cfccf49b6332cf3f2ca164fd71ae023e (diff)
downloadcmake-df6b077625f86e4ec0d534f6cd88f8610c5b8f8a.tar.gz
cmake: Remove broken '--warn-unused-vars' option
This option has been broken since commit b9f9915516 (cmMakefile: Remove VarUsageStack., 2015-05-17, v3.3.0-rc1~52^2). That commit removed the check that an initialized variable has actually been used and caused the option to warn on every variable ever set. This was not caught by the test suite because the test for the feature only checked that warnings appear when needed and not that they do not appear when not needed. The option was never very practical to use. Remove it to avoid the runtime cost of usage tracking and checks for every variable (which we were doing even when the option was not used).
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r--Source/cmDefinitions.cxx14
1 files changed, 0 insertions, 14 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 69a64276bc..4a4f87d8b2 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -19,7 +19,6 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(const std::string& key,
{
auto it = begin->Map.find(cm::String::borrow(key));
if (it != begin->Map.end()) {
- it->second.Used = true;
return it->second;
}
}
@@ -108,16 +107,3 @@ void cmDefinitions::Unset(const std::string& key)
{
this->Map[key] = Def();
}
-
-std::vector<std::string> cmDefinitions::UnusedKeys() const
-{
- std::vector<std::string> keys;
- keys.reserve(this->Map.size());
- // Consider local definitions.
- for (auto const& mi : this->Map) {
- if (!mi.second.Used) {
- keys.push_back(*mi.first.str_if_stable());
- }
- }
- return keys;
-}