more serializer fixes

This commit is contained in:
Jacob Dufault 2017-03-08 01:00:39 -08:00
parent 4e2f24ac17
commit 9b89bfc905
3 changed files with 4 additions and 6 deletions

View File

@ -365,7 +365,7 @@ struct FuncDefDefinitionData {
std::vector<FuncRef> callees; std::vector<FuncRef> callees;
FuncDefDefinitionData(const std::string& usr) : usr(usr) { FuncDefDefinitionData(const std::string& usr) : usr(usr) {
assert(usr.size() > 0); //assert(usr.size() > 0);
} }
bool operator==(const FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Location>& other) const { bool operator==(const FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Location>& other) const {
@ -409,7 +409,7 @@ struct IndexedFuncDef {
IndexedFuncDef() : def("") {} // For serialization IndexedFuncDef() : def("") {} // For serialization
IndexedFuncDef(FuncId id, const std::string& usr) : id(id), def(usr) { IndexedFuncDef(FuncId id, const std::string& usr) : id(id), def(usr) {
assert(usr.size() > 0); //assert(usr.size() > 0);
} }
bool operator<(const IndexedFuncDef& other) const { bool operator<(const IndexedFuncDef& other) const {
@ -471,7 +471,7 @@ struct IndexedVarDef {
IndexedVarDef() : def("") {} // For serialization IndexedVarDef() : def("") {} // For serialization
IndexedVarDef(VarId id, const std::string& usr) : id(id), def(usr) { IndexedVarDef(VarId id, const std::string& usr) : id(id), def(usr) {
assert(usr.size() > 0); //assert(usr.size() > 0);
} }
bool operator<(const IndexedVarDef& other) const { bool operator<(const IndexedVarDef& other) const {

View File

@ -122,7 +122,7 @@ void Reflect(Reader& visitor, std::vector<T>& values) {
} }
} }
template<typename T> template<typename T>
void Reflect(Reader& visitor, optional<T> value) { void Reflect(Reader& visitor, optional<T>& value) {
T real_value; T real_value;
Reflect(visitor, real_value); Reflect(visitor, real_value);
value = real_value; value = real_value;

View File

@ -74,8 +74,6 @@ void DiffDocuments(rapidjson::Document& expected, rapidjson::Document& actual) {
} }
void VerifySerializeToFrom(IndexedFile& file) { void VerifySerializeToFrom(IndexedFile& file) {
return; // TODO
std::string expected = file.ToString(); std::string expected = file.ToString();
std::string actual = Deserialize("foo.cc", Serialize(file)).ToString(); std::string actual = Deserialize("foo.cc", Serialize(file)).ToString();
if (expected != actual) { if (expected != actual) {