diff --git a/src/command_line.cc b/src/command_line.cc index a7032d5c..a47e641c 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -3001,10 +3001,12 @@ int main(int argc, char** argv) { for (int i = 0; i < 1; ++i) RunTests(); + /* for (int i = 0; i < 1; ++i) { std::this_thread::sleep_for(std::chrono::seconds(5)); std::cerr << "[POST] Memory usage: " << GetProcessMemoryUsedInMb() << "mb" << std::endl; } + */ std::cerr << std::endl << "[Enter] to exit" << std::endl; std::cin.get(); diff --git a/src/indexer.cc b/src/indexer.cc index d4934580..31387011 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1596,31 +1596,6 @@ std::vector> Parse( entry->args = args; } - // TODO: Fix interesting checks. - for (auto& entry : result) { - for (auto& type : entry->types) { - if (!type.HasInterestingState()) { - std::cerr << "!!!! NO INTERESTING STATE FOR " << entry->path << " of !!! " << file << std::endl; - std::cerr << "!!!! USR " << type.def.usr << std::endl; - assert(false); - } - } - for (auto& func : entry->funcs) { - if (!func.HasInterestingState()) { - std::cerr << "!!!! NO INTERESTING STATE FOR " << entry->path << " of !!! " << file << std::endl; - std::cerr << "!!!! USR " << func.def.usr << std::endl; - assert(false); - } - } - for (auto& var : entry->vars) { - if (!var.HasInterestingState()) { - std::cerr << "!!!! NO INTERESTING STATE FOR " << entry->path << " of !!! " << file << std::endl; - std::cerr << "!!!! USR " << var.def.usr << std::endl; - assert(false); - } - } - } - return result; } diff --git a/src/indexer.h b/src/indexer.h index 73f1a823..ba3844bc 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -177,19 +177,6 @@ struct TypeDefDefinitionData { TypeDefDefinitionData() {} // For reflection. TypeDefDefinitionData(const std::string& usr) : usr(usr) {} - bool HasInterestingState() const { - return - !short_name.empty() || - !detailed_name.empty() || - definition_spelling || - definition_extent || - alias_of || - !parents.empty() || - !types.empty() || - !funcs.empty() || - !vars.empty(); - } - bool operator==(const TypeDefDefinitionData& other) const { return usr == other.usr && short_name == other.short_name && @@ -247,14 +234,6 @@ struct IndexType { IndexType(IndexTypeId id, const std::string& usr); - bool HasInterestingState() const { - return - def.HasInterestingState() || - !derived.empty() || - !instances.empty() || - !uses.empty(); - } - bool operator<(const IndexType& other) const { return def.usr < other.def.usr; } @@ -292,18 +271,6 @@ struct FuncDefDefinitionData { // assert(usr.size() > 0); } - bool HasInterestingState() const { - return - !short_name.empty() || - !detailed_name.empty() || - definition_spelling || - definition_extent || - declaring_type || - base || - !locals.empty() || - !callees.empty(); - } - bool operator==( const FuncDefDefinitionData& other) const { @@ -367,15 +334,6 @@ struct IndexFunc { // assert(usr.size() > 0); } - bool HasInterestingState() const { - return - def.HasInterestingState() || - !def.callees.empty() || - !declarations.empty() || - !derived.empty() || - !callers.empty(); - } - bool operator<(const IndexFunc& other) const { return def.usr < other.def.usr; } @@ -409,16 +367,6 @@ struct VarDefDefinitionData { VarDefDefinitionData() {} // For reflection. VarDefDefinitionData(const std::string& usr) : usr(usr) {} - bool HasInterestingState() const { - return - !short_name.empty() || - !detailed_name.empty() || - declaration || - definition_spelling || - definition_extent || - variable_type || - declaring_type; - } bool operator==(const VarDefDefinitionData& other) const { return usr == other.usr && short_name == other.short_name && @@ -469,12 +417,6 @@ struct IndexVar { // assert(usr.size() > 0); } - bool HasInterestingState() const { - return - def.HasInterestingState() || - !uses.empty(); - } - bool operator<(const IndexVar& other) const { return def.usr < other.def.usr; } diff --git a/src/serializer.cc b/src/serializer.cc index 3fa5e509..c1ea7e57 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -71,22 +71,6 @@ void ReflectMember(Writer& visitor, const char* name, std::string& value) { // TODO: Move this to indexer.cc -// IndexType -bool ReflectMemberStart(Reader& reader, IndexType& value) { - //value.is_bad_def = false; - return true; -} -bool ReflectMemberStart(Writer& writer, IndexType& value) { - // TODO: this is crashing - // if (!value.HasInterestingState()) - // std::cerr << "bad"; - // assert(value.HasInterestingState()); - - if (!value.HasInterestingState()) - return false; - DefaultReflectMemberStart(writer); - return true; -} template void Reflect(TVisitor& visitor, IndexType& value) { REFLECT_MEMBER_START(); @@ -108,22 +92,6 @@ void Reflect(TVisitor& visitor, IndexType& value) { } -// IndexFunc -bool ReflectMemberStart(Reader& reader, IndexFunc& value) { - //value.is_bad_def = false; - return true; -} -bool ReflectMemberStart(Writer& writer, IndexFunc& value) { - // TODO: this is crashing - // if (!value.HasInterestingState()) - // std::cerr << "bad"; - // assert(value.HasInterestingState()); - - if (!value.HasInterestingState()) - return false; - DefaultReflectMemberStart(writer); - return true; -} template void Reflect(TVisitor& visitor, IndexFunc& value) { REFLECT_MEMBER_START(); @@ -144,22 +112,6 @@ void Reflect(TVisitor& visitor, IndexFunc& value) { } -// IndexVar -bool ReflectMemberStart(Reader& reader, IndexVar& value) { - //value.is_bad_def = false; - return true; -} -bool ReflectMemberStart(Writer& writer, IndexVar& value) { - // TODO: this is crashing - // if (!value.HasInterestingState()) - // std::cerr << "bad"; - // assert(value.HasInterestingState()); - - if (!value.HasInterestingState()) - return false; - DefaultReflectMemberStart(writer); - return true; -} template void Reflect(TVisitor& visitor, IndexVar& value) { REFLECT_MEMBER_START();