Browse Source

[clang][index-while-building][NFC] Comment about implementation detail in FileIndexRecord

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355061 91177308-0d34-0410-b5e6-96231b3b80d8
Jan Korous 6 years ago
parent
commit
868d5cc1e7
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/Index/FileIndexRecord.cpp

+ 1 - 0
lib/Index/FileIndexRecord.cpp

@@ -35,6 +35,7 @@ void FileIndexRecord::addDeclOccurence(SymbolRoleSet Roles, unsigned Offset,
   }
 
   DeclOccurrence NewInfo(Roles, Offset, D, Relations);
+  // We keep Decls in order as we need to access them in this order in all cases.
   auto It = std::upper_bound(Decls.begin(), Decls.end(), NewInfo);
   Decls.insert(It, std::move(NewInfo));
 }