[clang] aacc110 - [clang-format][NFC] Fix typos and inconsistencies
via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 20 17:21:10 PST 2022
Author: Krystian Kuzniarek
Date: 2022-02-20T17:20:34-08:00
New Revision: aacc110bdce71d1405d820cf282196855afeee26
URL: https://github.com/llvm/llvm-project/commit/aacc110bdce71d1405d820cf282196855afeee26
DIFF: https://github.com/llvm/llvm-project/commit/aacc110bdce71d1405d820cf282196855afeee26.diff
LOG: [clang-format][NFC] Fix typos and inconsistencies
Differential Revision: https://reviews.llvm.org/D120220
Added:
Modified:
clang/lib/Format/Format.cpp
Removed:
################################################################################
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 6acd850cac2cb..bc3f0c93426bf 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -990,11 +990,11 @@ std::string ParseErrorCategory::message(int EV) const {
case ParseError::InvalidQualifierSpecified:
return "Invalid qualifier specified in QualifierOrder";
case ParseError::DuplicateQualifierSpecified:
- return "Duplicate qualifier specified in QualfierOrder";
+ return "Duplicate qualifier specified in QualifierOrder";
case ParseError::MissingQualifierType:
- return "Missing type in QualfierOrder";
+ return "Missing type in QualifierOrder";
case ParseError::MissingQualifierOrder:
- return "Missing QualfierOrder";
+ return "Missing QualifierOrder";
}
llvm_unreachable("unexpected parse error");
}
@@ -1650,7 +1650,8 @@ ParseError validateQualifierOrder(FormatStyle *Style) {
if (token == tok::identifier)
return ParseError::InvalidQualifierSpecified;
}
- // Ensure the list is unqiue (no duplicates).
+
+ // Ensure the list is unique (no duplicates).
std::set<std::string> UniqueQualifiers(Style->QualifierOrder.begin(),
Style->QualifierOrder.end());
if (Style->QualifierOrder.size() != UniqueQualifiers.size()) {
@@ -1660,10 +1661,12 @@ ParseError validateQualifierOrder(FormatStyle *Style) {
return ParseError::DuplicateQualifierSpecified;
}
+ // Ensure the list has 'type' in it
auto type = std::find(Style->QualifierOrder.begin(),
Style->QualifierOrder.end(), "type");
if (type == Style->QualifierOrder.end())
return ParseError::MissingQualifierType;
+
return ParseError::Success;
}
More information about the cfe-commits
mailing list