diff options
| author | Leonard Chan <leonardchan@google.com> | 2018-10-15 20:00:03 +0000 |
|---|---|---|
| committer | Leonard Chan <leonardchan@google.com> | 2018-10-15 20:00:03 +0000 |
| commit | 0f11b73f96ce1f84c53636bbc00445ee6faff6d8 (patch) | |
| tree | 78ab882d9032e0af88c9304d7a24867a6f8d7190 /clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp | |
| parent | 88ccbd75431c4dc9e3e7bb48fba86a264d6ddfa1 (diff) | |
| download | bcm5719-llvm-0f11b73f96ce1f84c53636bbc00445ee6faff6d8.tar.gz bcm5719-llvm-0f11b73f96ce1f84c53636bbc00445ee6faff6d8.zip | |
[Fixed Point Arithmetic] Fix for clang-tools-extra warning
Fix for warnings generated on unhandled enum value `STK_FixedPoint`.
Differential Revision: https://reviews.llvm.org/D53299
llvm-svn: 344549
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp index 0e0bd36a307..23a3e1fab41 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp @@ -60,46 +60,47 @@ static StringRef getValueOfValueInit(const QualType InitType) { case Type::STK_IntegralComplex: return getValueOfValueInit( InitType->getAs<ComplexType>()->getElementType()); + case Type::STK_FixedPoint: switch (InitType->getAs<BuiltinType>()->getKind()) { - case BuiltinType::ShortAccum: - case BuiltinType::SatShortAccum: - return "0.0hk"; - case BuiltinType::Accum: - case BuiltinType::SatAccum: - return "0.0k"; - case BuiltinType::LongAccum: - case BuiltinType::SatLongAccum: - return "0.0lk"; - case BuiltinType::UShortAccum: - case BuiltinType::SatUShortAccum: - return "0.0uhk"; - case BuiltinType::UAccum: - case BuiltinType::SatUAccum: - return "0.0uk"; - case BuiltinType::ULongAccum: - case BuiltinType::SatULongAccum: - return "0.0ulk"; - case BuiltinType::ShortFract: - case BuiltinType::SatShortFract: - return "0.0hr"; - case BuiltinType::Fract: - case BuiltinType::SatFract: - return "0.0r"; - case BuiltinType::LongFract: - case BuiltinType::SatLongFract: - return "0.0lr"; - case BuiltinType::UShortFract: - case BuiltinType::SatUShortFract: - return "0.0uhr"; - case BuiltinType::UFract: - case BuiltinType::SatUFract: - return "0.0ur"; - case BuiltinType::ULongFract: - case BuiltinType::SatULongFract: - return "0.0ulr"; - default: - llvm_unreachable("Unhandled fixed point BuiltinType"); + case BuiltinType::ShortAccum: + case BuiltinType::SatShortAccum: + return "0.0hk"; + case BuiltinType::Accum: + case BuiltinType::SatAccum: + return "0.0k"; + case BuiltinType::LongAccum: + case BuiltinType::SatLongAccum: + return "0.0lk"; + case BuiltinType::UShortAccum: + case BuiltinType::SatUShortAccum: + return "0.0uhk"; + case BuiltinType::UAccum: + case BuiltinType::SatUAccum: + return "0.0uk"; + case BuiltinType::ULongAccum: + case BuiltinType::SatULongAccum: + return "0.0ulk"; + case BuiltinType::ShortFract: + case BuiltinType::SatShortFract: + return "0.0hr"; + case BuiltinType::Fract: + case BuiltinType::SatFract: + return "0.0r"; + case BuiltinType::LongFract: + case BuiltinType::SatLongFract: + return "0.0lr"; + case BuiltinType::UShortFract: + case BuiltinType::SatUShortFract: + return "0.0uhr"; + case BuiltinType::UFract: + case BuiltinType::SatUFract: + return "0.0ur"; + case BuiltinType::ULongFract: + case BuiltinType::SatULongFract: + return "0.0ulr"; + default: + llvm_unreachable("Unhandled fixed point BuiltinType"); } } llvm_unreachable("Invalid scalar type kind"); |

