From: Puyan Lotfi Date: Fri, 30 Aug 2019 20:25:46 +0000 (+0000) Subject: [IFS][NFC] llvm-ifs: Fixing build bot build break: revert r370517 and r370510. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=593cd77e46843616478942a1c1dc0e2dba6d1d50;p=llvm [IFS][NFC] llvm-ifs: Fixing build bot build break: revert r370517 and r370510. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370522 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-ifs/llvm-ifs.cpp b/tools/llvm-ifs/llvm-ifs.cpp index 63f774f3751..3377985ae4a 100644 --- a/tools/llvm-ifs/llvm-ifs.cpp +++ b/tools/llvm-ifs/llvm-ifs.cpp @@ -85,8 +85,10 @@ struct IFSSymbol { bool operator<(const IFSSymbol &RHS) const { return Name < RHS.Name; } }; +namespace llvm { +namespace yaml { /// YAML traits for IFSSymbolType. -template <> struct llvm::yaml::ScalarEnumerationTraits { +template <> struct ScalarEnumerationTraits { static void enumeration(IO &IO, IFSSymbolType &SymbolType) { IO.enumCase(SymbolType, "NoType", IFSSymbolType::NoType); IO.enumCase(SymbolType, "Func", IFSSymbolType::Func); @@ -98,7 +100,7 @@ template <> struct llvm::yaml::ScalarEnumerationTraits { } }; -template <> struct llvm::yaml::ScalarTraits { +template <> struct ScalarTraits { static void output(const VersionTuple &Value, void *, llvm::raw_ostream &Out) { Out << Value.getAsString(); @@ -120,7 +122,7 @@ template <> struct llvm::yaml::ScalarTraits { }; /// YAML traits for IFSSymbol. -template <> struct llvm::yaml::MappingTraits { +template <> struct MappingTraits { static void mapping(IO &IO, IFSSymbol &Symbol) { IO.mapRequired("Type", Symbol.Type); // The need for symbol size depends on the symbol type. @@ -139,7 +141,7 @@ template <> struct llvm::yaml::MappingTraits { }; /// YAML traits for set of IFSSymbols. -template <> struct llvm::yaml::CustomMappingTraits> { +template <> struct CustomMappingTraits> { static void inputOne(IO &IO, StringRef Key, std::set &Set) { std::string Name = Key.str(); IFSSymbol Sym(Name); @@ -152,6 +154,8 @@ template <> struct llvm::yaml::CustomMappingTraits> { IO.mapRequired(Sym.Name.c_str(), const_cast(Sym)); } }; +} // End yaml namespace +} // End llvm namespace // A cumulative representation of ELF stubs. // Both textual and binary stubs will read into and write from this object. @@ -177,8 +181,10 @@ public: Symbols(std::move(Stub.Symbols)) {} }; +namespace llvm { +namespace yaml { /// YAML traits for IFSStub objects. -template <> struct llvm::yaml::MappingTraits { +template <> struct MappingTraits { static void mapping(IO &IO, IFSStub &Stub) { if (!IO.mapTag("!experimental-ifs-v1", true)) IO.setError("Not a .ifs YAML file."); @@ -190,6 +196,8 @@ template <> struct llvm::yaml::MappingTraits { IO.mapRequired("Symbols", Stub.Symbols); } }; +} // End yaml namespace +} // End llvm namespace static Expected> readInputFile(StringRef FilePath) { // Read in file.