summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-16 20:45:11 +0000
committerZachary Turner <zturner@google.com>2017-03-16 20:45:11 +0000
commitc9500616d8ef8d62541841ded717ac15c51d2938 (patch)
tree61ada73d2a8b3b7c3a7fbec471f3794fc1785dd9 /llvm/lib/DebugInfo/PDB
parent6105bb5eaf65c4d58a72e51cb2399b590c8fcb16 (diff)
downloadbcm5719-llvm-c9500616d8ef8d62541841ded717ac15c51d2938.tar.gz
bcm5719-llvm-c9500616d8ef8d62541841ded717ac15c51d2938.zip
Silence -Wcovered-switch-default warning.
llvm-svn: 297990
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp
index 0b223379b26..2a1d12e8239 100644
--- a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud