Silence these C4715 warnings from Visual C++ (NFC)

llvm\tools\lld\lib\readerwriter\macho\macholinkingcontext.cpp(647):
warning C4715: 'lld::MachOLinkingContext::exportSymbolNamed' :
not all control paths return a value

llvm\tools\lld\lib\readerwriter\macho\machonormalizedfilefromatoms.cpp(723):
warning C4715: '`anonymous namespace'::Util::getSymbolTableRegion' :
not all control paths return a value

While all enum values do appear in the switch, an uninitialized or corrupted
enum variable would not be caught without the default: case in the switch.

llvm-svn: 218197
This commit is contained in:
Yaron Keren 2014-09-21 04:13:45 +00:00
parent da7c5b253f
commit 84f3816f85
2 changed files with 5 additions and 0 deletions

View File

@ -643,6 +643,8 @@ bool MachOLinkingContext::exportSymbolNamed(StringRef sym) const {
return _exportedSymbols.count(sym);
case ExportMode::blackList:
return !_exportedSymbols.count(sym);
default:
llvm_unreachable("_exportMode unknown enum value");
}
}

View File

@ -719,6 +719,9 @@ std::error_code Util::getSymbolTableRegion(const DefinedAtom* atom,
return std::error_code();
}
break;
default:
llvm_unreachable("atom->scope() unknown enum value");
return std::error_code();
}
}