summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/IndexingContext.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-04-21 05:42:46 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-04-21 05:42:46 +0000
commit6e5ca5be537b1812ffc000b44deb91dd260e40b5 (patch)
tree4e8b044ab076a69368130ccb1ad451c7d279983b /clang/lib/Index/IndexingContext.cpp
parentf932612fdf942ca90a5fdca2a9423450258fedca (diff)
downloadbcm5719-llvm-6e5ca5be537b1812ffc000b44deb91dd260e40b5.tar.gz
bcm5719-llvm-6e5ca5be537b1812ffc000b44deb91dd260e40b5.zip
[index] Take advantage of 'external_source_symbol' attribute for indexing purposes
- Ignore decls marked as 'generated_declaration' - Include the 'defined_in' in the USR for additional namespacing llvm-svn: 300949
Diffstat (limited to 'clang/lib/Index/IndexingContext.cpp')
-rw-r--r--clang/lib/Index/IndexingContext.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Index/IndexingContext.cpp b/clang/lib/Index/IndexingContext.cpp
index 85574d0a314..254abecd4e4 100644
--- a/clang/lib/Index/IndexingContext.cpp
+++ b/clang/lib/Index/IndexingContext.cpp
@@ -17,6 +17,17 @@
using namespace clang;
using namespace index;
+static bool isGeneratedDecl(const Decl *D) {
+ if (auto *attr = D->getAttr<ExternalSourceSymbolAttr>()) {
+ return attr->getGeneratedDeclaration();
+ }
+ return false;
+}
+
+bool IndexingContext::shouldIndex(const Decl *D) {
+ return !isGeneratedDecl(D);
+}
+
bool IndexingContext::shouldIndexFunctionLocalSymbols() const {
return IndexOpts.IndexFunctionLocals;
}
OpenPOWER on IntegriCloud