summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/IndexingContext.cpp
diff options
context:
space:
mode:
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