================ @@ -259,32 +306,40 @@ Error IR2VecVocabAnalysis::readVocabulary() { return createFileError(VocabFile, BufOrError.getError()); auto Content = BufOrError.get()->getBuffer(); - json::Path::Root Path(""); + Expected<json::Value> ParsedVocabValue = json::parse(Content); if (!ParsedVocabValue) return ParsedVocabValue.takeError(); - bool Res = json::fromJSON(*ParsedVocabValue, Vocabulary, Path); - if (!Res) - return createStringError(errc::illegal_byte_sequence, - "Unable to parse the vocabulary"); + ir2vec::Vocab OpcodeVocab, TypeVocab, ArgVocab; + unsigned OpcodeDim, TypeDim, ArgDim; + if (auto Err = parseVocabSection("Opcodes", *ParsedVocabValue, OpcodeVocab, ---------------- mtrofin wrote:
This changes the format, best to also update the doc. Also, this means the sections must all be present, even if empty, correct? SGTM, just something worth spelling out. https://github.com/llvm/llvm-project/pull/143986 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits