diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-22 19:43:45 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-22 19:43:45 +0000 |
commit | aa803409c3bd3930126db630c29f63d42f255153 (patch) | |
tree | 042106605c08352895ba4383ef97eae88b6b31aa /lib/Index/IndexSymbol.cpp | |
parent | 1ce08792766261dcaa25d8215f9d1c2f70d7b7e9 (diff) |
Diffstat (limited to 'lib/Index/IndexSymbol.cpp')
-rw-r--r-- | lib/Index/IndexSymbol.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/Index/IndexSymbol.cpp b/lib/Index/IndexSymbol.cpp index 0bfa19346b4ef..0b20970acc3b3 100644 --- a/lib/Index/IndexSymbol.cpp +++ b/lib/Index/IndexSymbol.cpp @@ -61,6 +61,8 @@ bool index::isFunctionLocalSymbol(const Decl *D) { if (isa<ObjCTypeParamDecl>(D)) return true; + if (isa<UsingDirectiveDecl>(D)) + return false; if (!D->getParentFunctionOrMethod()) return false; @@ -318,16 +320,7 @@ SymbolInfo index::getSymbolInfo(const Decl *D) { if (Info.Properties & (unsigned)SymbolProperty::Generic) Info.Lang = SymbolLanguage::CXX; - auto getExternalSymAttr = [](const Decl *D) -> ExternalSourceSymbolAttr* { - if (auto *attr = D->getAttr<ExternalSourceSymbolAttr>()) - return attr; - if (auto *dcd = dyn_cast<Decl>(D->getDeclContext())) { - if (auto *attr = dcd->getAttr<ExternalSourceSymbolAttr>()) - return attr; - } - return nullptr; - }; - if (auto *attr = getExternalSymAttr(D)) { + if (auto *attr = D->getExternalSourceSymbolAttr()) { if (attr->getLanguage() == "Swift") Info.Lang = SymbolLanguage::Swift; } |