[PATCH] D18833: [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 7 07:44:03 PDT 2016
alexfh added a comment.
Missed a couple of nits.
================
Comment at: clang-tidy/misc/MisplacedWideningCastCheck.cpp:98
@@ -96,40 +97,3 @@
-static llvm::SmallDenseMap<int, int> createRelativeIntSizesMap() {
- llvm::SmallDenseMap<int, int> Result;
- Result[BuiltinType::UChar] = 1;
- Result[BuiltinType::SChar] = 1;
- Result[BuiltinType::Char_U] = 1;
- Result[BuiltinType::Char_S] = 1;
- Result[BuiltinType::UShort] = 2;
- Result[BuiltinType::Short] = 2;
- Result[BuiltinType::UInt] = 3;
- Result[BuiltinType::Int] = 3;
- Result[BuiltinType::ULong] = 4;
- Result[BuiltinType::Long] = 4;
- Result[BuiltinType::ULongLong] = 5;
- Result[BuiltinType::LongLong] = 5;
- Result[BuiltinType::UInt128] = 6;
- Result[BuiltinType::Int128] = 6;
- return Result;
-}
-
-static llvm::SmallDenseMap<int, int> createRelativeCharSizesMap() {
- llvm::SmallDenseMap<int, int> Result;
- Result[BuiltinType::UChar] = 1;
- Result[BuiltinType::SChar] = 1;
- Result[BuiltinType::Char_U] = 1;
- Result[BuiltinType::Char_S] = 1;
- Result[BuiltinType::Char16] = 2;
- Result[BuiltinType::Char32] = 3;
- return Result;
-}
-
-static llvm::SmallDenseMap<int, int> createRelativeCharSizesWMap() {
- llvm::SmallDenseMap<int, int> Result;
- Result[BuiltinType::UChar] = 1;
- Result[BuiltinType::SChar] = 1;
- Result[BuiltinType::Char_U] = 1;
- Result[BuiltinType::Char_S] = 1;
- Result[BuiltinType::WChar_U] = 2;
- Result[BuiltinType::WChar_S] = 2;
- return Result;
+static int RelativeIntSizes(BuiltinType::Kind kind) {
+ switch (kind) {
----------------
s/RelativeIntSizes/relativeIntSize/
s/kind/Kind/
http://reviews.llvm.org/D18833
More information about the cfe-commits
mailing list