summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-10-04 17:18:49 +0000
committerSam McCall <sam.mccall@gmail.com>2018-10-04 17:18:49 +0000
commitaa728f1afa30afbd6aa4c0d9b2712c4e78f66cbe (patch)
tree782900d15e8a1039c4c8f0f2c577b9ac39182203
parentbd7718ec268ef900f0af9fdb795ebf095821d2d9 (diff)
downloadbcm5719-llvm-aa728f1afa30afbd6aa4c0d9b2712c4e78f66cbe.tar.gz
bcm5719-llvm-aa728f1afa30afbd6aa4c0d9b2712c4e78f66cbe.zip
[clangd] Dex: FALSE iterator, peephole optimizations, fix AND bug
Summary: The FALSE iterator will be used in a followup patch to fix a logic bug in Dex (currently, tokens that don't have posting lists in the index are simply dropped from the query, changing semantics). It can usually be optimized away, so added the following opmitizations: - simplify booleans inside AND/OR - replace effectively-empty AND/OR with booleans - flatten nested AND/ORs While working on this, found a bug in the AND iterator: its constructor sync() assumes that ReachedEnd is set if applicable, but the constructor never sets it. This crashes if a non-first iterator is nonempty. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52789 llvm-svn: 343801
-rw-r--r--clang-tools-extra/clangd/index/dex/Iterator.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/index/dex/Iterator.h b/clang-tools-extra/clangd/index/dex/Iterator.h
index 149fd43adb8..25922fba9fd 100644
--- a/clang-tools-extra/clangd/index/dex/Iterator.h
+++ b/clang-tools-extra/clangd/index/dex/Iterator.h
@@ -106,6 +106,7 @@ protected:
Iterator(Kind MyKind = Kind::Other) : MyKind(MyKind) {}
private:
+ Kind MyKind;
virtual llvm::raw_ostream &dump(llvm::raw_ostream &OS) const = 0;
Kind MyKind;
};
OpenPOWER on IntegriCloud