From a4de46b9a0033a712a203cf8476a18c216a5a998 Mon Sep 17 00:00:00 2001 From: Felipe Lema <1232306+FelipeLema@users.noreply.github.com> Date: Mon, 12 Apr 2021 14:31:45 -0400 Subject: [PATCH] name types for (trace|read)ability --- src/position.hh | 6 ++++-- src/query.hh | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/position.hh b/src/position.hh index e59804d2..fd953cb2 100644 --- a/src/position.hh +++ b/src/position.hh @@ -10,8 +10,10 @@ namespace ccls { struct Pos { - uint16_t line = 0; - int16_t column = -1; + using Line=uint16_t; + Line line = 0; + using Column=int16_t; + Column column = -1; static Pos fromString(const std::string &encoded); diff --git a/src/query.hh b/src/query.hh index cd3a19c1..dee5ff52 100644 --- a/src/query.hh +++ b/src/query.hh @@ -146,7 +146,10 @@ using Lid2file_id = std::unordered_map; struct DB { std::vector files; llvm::StringMap name2file_id; - llvm::DenseMap func_usr, type_usr, var_usr; + //! Underlying type used for indexes-of-Usr + using UsrIndex=int; + //! Usr → index + llvm::DenseMap func_usr, type_usr, var_usr; llvm::SmallVector funcs; llvm::SmallVector types; llvm::SmallVector vars;