Positions are now 32 bits (down from 96ish)

This commit is contained in:
Jacob Dufault 2017-04-18 22:38:39 -07:00
parent 95b567838c
commit cd50eb9e35
3 changed files with 11 additions and 11 deletions

View File

@ -1378,32 +1378,31 @@ std::vector<std::unique_ptr<IndexedFile>> Parse(IndexerConfig* config, FileConsu
entry->id_cache.primary_file = entry->path; entry->id_cache.primary_file = entry->path;
} }
/* // TODO: Fix interesting checks.
TODO: Fix interesting checks.
for (auto& entry : result) { for (auto& entry : result) {
for (auto& type : entry->types) { for (auto& type : entry->types) {
if (!type.HasInterestingState()) { if (!type.HasInterestingState()) {
std::cerr << "!!!! NO INTERSETING STATE FOR " << entry->path << " of !!! " << filename << std::endl; std::cerr << "!!!! NO INTERESTING STATE FOR " << entry->path << " of !!! " << filename << std::endl;
std::cerr << "!!!! USR " << type.def.usr << std::endl; std::cerr << "!!!! USR " << type.def.usr << std::endl;
assert(false); assert(false);
} }
} }
for (auto& func : entry->funcs) { for (auto& func : entry->funcs) {
if (!func.HasInterestingState()) { if (!func.HasInterestingState()) {
std::cerr << "!!!! NO INTERSETING STATE FOR " << entry->path << " of !!! " << filename << std::endl; std::cerr << "!!!! NO INTERESTING STATE FOR " << entry->path << " of !!! " << filename << std::endl;
std::cerr << "!!!! USR " << func.def.usr << std::endl; std::cerr << "!!!! USR " << func.def.usr << std::endl;
assert(false); assert(false);
} }
} }
for (auto& var : entry->vars) { for (auto& var : entry->vars) {
if (!var.HasInterestingState()) { if (!var.HasInterestingState()) {
std::cerr << "!!!! NO INTERSETING STATE FOR " << entry->path << " of !!! " << filename << std::endl; std::cerr << "!!!! NO INTERESTING STATE FOR " << entry->path << " of !!! " << filename << std::endl;
std::cerr << "!!!! USR " << var.def.usr << std::endl; std::cerr << "!!!! USR " << var.def.usr << std::endl;
assert(false); assert(false);
} }
} }
} }
*/
return result; return result;
} }

View File

@ -5,8 +5,8 @@
#include <string> #include <string>
struct Position { struct Position {
int32_t line = -1; int16_t line = -1;
int32_t column = -1; int16_t column = -1;
Position(); Position();
Position(int32_t line, int32_t column); Position(int32_t line, int32_t column);
@ -21,6 +21,7 @@ struct Position {
bool operator!=(const Position& that) const; bool operator!=(const Position& that) const;
bool operator<(const Position& that) const; bool operator<(const Position& that) const;
}; };
static_assert(sizeof(Position) == 4, "Investigate, Position should be 32-bits for indexer size reasons");
struct Range { struct Range {
Position start; Position start;

View File

@ -22,7 +22,7 @@ void Reflect(Reader& visitor, std::string& value) {
value = visitor.GetString(); value = visitor.GetString();
} }
void Reflect(Writer& visitor, std::string& value) { void Reflect(Writer& visitor, std::string& value) {
visitor.String(value.c_str(), value.size()); visitor.String(value.c_str(), (rapidjson::SizeType)value.size());
} }
@ -41,7 +41,7 @@ void Reflect(Reader& visitor, Position& value) {
} }
void Reflect(Writer& visitor, Position& value) { void Reflect(Writer& visitor, Position& value) {
std::string output = value.ToString(); std::string output = value.ToString();
visitor.String(output.c_str(), output.size()); visitor.String(output.c_str(), (rapidjson::SizeType)output.size());
} }
@ -51,7 +51,7 @@ void Reflect(Reader& visitor, Range& value) {
} }
void Reflect(Writer& visitor, Range& value) { void Reflect(Writer& visitor, Range& value) {
std::string output = value.ToString(); std::string output = value.ToString();
visitor.String(output.c_str(), output.size()); visitor.String(output.c_str(), (rapidjson::SizeType)output.size());
} }
// Id<T> // Id<T>