From aa803409c3bd3930126db630c29f63d42f255153 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 22 May 2017 19:43:45 +0000 Subject: Vendor import of clang trunk r303571: https://llvm.org/svn/llvm-project/cfe/trunk@303571 --- lib/Index/IndexSymbol.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/Index/IndexSymbol.cpp') 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(D)) return true; + if (isa(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()) - return attr; - if (auto *dcd = dyn_cast(D->getDeclContext())) { - if (auto *attr = dcd->getAttr()) - return attr; - } - return nullptr; - }; - if (auto *attr = getExternalSymAttr(D)) { + if (auto *attr = D->getExternalSourceSymbolAttr()) { if (attr->getLanguage() == "Swift") Info.Lang = SymbolLanguage::Swift; } -- cgit v1.2.3