From a07d9f35861e4d6b9de2a99f91b6ea5a98da9937 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 16 Mar 2017 20:45:11 +0000 Subject: [PATCH] Silence -Wcovered-switch-default warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297990 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/PDB/Native/InfoStream.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/DebugInfo/PDB/Native/InfoStream.cpp b/lib/DebugInfo/PDB/Native/InfoStream.cpp index 0b223379b26..2a1d12e8239 100644 --- a/lib/DebugInfo/PDB/Native/InfoStream.cpp +++ b/lib/DebugInfo/PDB/Native/InfoStream.cpp @@ -62,18 +62,22 @@ Error InfoStream::reload() { PdbRaw_FeatureSig Sig; if (auto EC = Reader.readEnum(Sig)) return EC; - switch (Sig) { - case PdbRaw_FeatureSig::VC110: + // Since this value comes from a file, it's possible we have some strange + // value which doesn't correspond to any value. We don't want to warn on + // -Wcovered-switch-default in this case, so switch on the integral value + // instead of the enumeration value. + switch (uint32_t(Sig)) { + case uint32_t(PdbRaw_FeatureSig::VC110): // No other flags for VC110 PDB. Stop = true; LLVM_FALLTHROUGH; - case PdbRaw_FeatureSig::VC140: + case uint32_t(PdbRaw_FeatureSig::VC140): Features |= PdbFeatureContainsIdStream; break; - case PdbRaw_FeatureSig::NoTypeMerge: + case uint32_t(PdbRaw_FeatureSig::NoTypeMerge): Features |= PdbFeatureNoTypeMerging; break; - case PdbRaw_FeatureSig::MinimalDebugInfo: + case uint32_t(PdbRaw_FeatureSig::MinimalDebugInfo): Features |= PdbFeatureMinimalDebugInfo; default: continue; -- 2.50.1