forked from OSchip/llvm-project
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:
parent
da7c5b253f
commit
84f3816f85
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue