summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-05-20 04:11:33 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-05-20 04:11:33 +0000
commit088eaf5b7b121f70b2fe6b4328b7d8819c9f2aab (patch)
treea8a413232d882ecbb75bb3777857e5f70e0d1200 /tools
parentc43ddad88323c190c3579268a24803d552e64a02 (diff)
[index] Fix forward declarations interfering with USR generation of external source symbols
Patch by Nathan Hawes. https://reviews.llvm.org/D33346 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/CIndex.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 9c795ae9c5..394ee0ec43 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -7487,16 +7487,7 @@ unsigned clang_Cursor_isExternalSymbol(CXCursor C,
const Decl *D = getCursorDecl(C);
- 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 (language)
*language = cxstring::createDup(attr->getLanguage());
if (definedIn)