1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Fix compilation warnings. NFC.

llvm-svn: 370504
This commit is contained in:
Michael Liao 2019-08-30 19:23:28 +00:00
parent 99225dd97f
commit ab94c7a42e

View File

@ -35,7 +35,7 @@ using namespace llvm::MachO;
namespace { namespace {
const VersionTuple IFSVersionCurrent(1, 2); const VersionTuple IFSVersionCurrent(1, 2);
}; }
static cl::opt<std::string> Action("action", cl::desc("<llvm-ifs action>"), static cl::opt<std::string> Action("action", cl::desc("<llvm-ifs action>"),
cl::value_desc("write-ifs | write-bin"), cl::value_desc("write-ifs | write-bin"),
@ -72,6 +72,7 @@ std::string getTypeName(IFSSymbolType Type) {
case IFSSymbolType::Unknown: case IFSSymbolType::Unknown:
return "Unknown"; return "Unknown";
} }
llvm_unreachable("Unexpected ifs symbol type.");
} }
struct IFSSymbol { struct IFSSymbol {
@ -84,6 +85,8 @@ struct IFSSymbol {
bool operator<(const IFSSymbol &RHS) const { return Name < RHS.Name; } bool operator<(const IFSSymbol &RHS) const { return Name < RHS.Name; }
}; };
namespace llvm {
namespace yaml {
/// YAML traits for IFSSymbolType. /// YAML traits for IFSSymbolType.
template <> struct ScalarEnumerationTraits<IFSSymbolType> { template <> struct ScalarEnumerationTraits<IFSSymbolType> {
static void enumeration(IO &IO, IFSSymbolType &SymbolType) { static void enumeration(IO &IO, IFSSymbolType &SymbolType) {
@ -151,6 +154,8 @@ template <> struct CustomMappingTraits<std::set<IFSSymbol>> {
IO.mapRequired(Sym.Name.c_str(), const_cast<IFSSymbol &>(Sym)); IO.mapRequired(Sym.Name.c_str(), const_cast<IFSSymbol &>(Sym));
} }
}; };
} // End yaml namespace
} // End llvm namespace
// A cumulative representation of ELF stubs. // A cumulative representation of ELF stubs.
// Both textual and binary stubs will read into and write from this object. // Both textual and binary stubs will read into and write from this object.
@ -176,6 +181,8 @@ public:
Symbols(std::move(Stub.Symbols)) {} Symbols(std::move(Stub.Symbols)) {}
}; };
namespace llvm {
namespace yaml {
/// YAML traits for IFSStub objects. /// YAML traits for IFSStub objects.
template <> struct MappingTraits<IFSStub> { template <> struct MappingTraits<IFSStub> {
static void mapping(IO &IO, IFSStub &Stub) { static void mapping(IO &IO, IFSStub &Stub) {
@ -189,6 +196,8 @@ template <> struct MappingTraits<IFSStub> {
IO.mapRequired("Symbols", Stub.Symbols); IO.mapRequired("Symbols", Stub.Symbols);
} }
}; };
} // End yaml namespace
} // End llvm namespace
static Expected<std::unique_ptr<IFSStub>> readInputFile(StringRef FilePath) { static Expected<std::unique_ptr<IFSStub>> readInputFile(StringRef FilePath) {
// Read in file. // Read in file.