summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-07-20 08:08:56 +0000
committerEric Liu <ioeric@google.com>2018-07-20 08:08:56 +0000
commit3e0051bb51b0a57f5d220bec3d7930a72bd7c057 (patch)
tree04212e4ff3c2ac185ab1705b3545ef96c09741af /clang/lib
parentc2c7d1548661dcf68afce2e5111d58ec4914082f (diff)
downloadbcm5719-llvm-3e0051bb51b0a57f5d220bec3d7930a72bd7c057.tar.gz
bcm5719-llvm-3e0051bb51b0a57f5d220bec3d7930a72bd7c057.zip
[Index] Set OrigD before D is changed.
Reviewers: akyrtzi, arphaman Reviewed By: akyrtzi Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49476 llvm-svn: 337529
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Index/IndexingContext.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Index/IndexingContext.cpp b/clang/lib/Index/IndexingContext.cpp
index 6c09ac7c09a..80d851b43d7 100644
--- a/clang/lib/Index/IndexingContext.cpp
+++ b/clang/lib/Index/IndexingContext.cpp
@@ -350,6 +350,9 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc,
}
}
+ if (!OrigD)
+ OrigD = D;
+
if (isTemplateImplicitInstantiation(D)) {
if (!IsRef)
return true;
@@ -359,9 +362,6 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc,
assert(!isTemplateImplicitInstantiation(D));
}
- if (!OrigD)
- OrigD = D;
-
if (IsRef)
Roles |= (unsigned)SymbolRole::Reference;
else if (isDeclADefinition(OrigD, ContainerDC, *Ctx))
OpenPOWER on IntegriCloud