aboutsummaryrefslogtreecommitdiff
path: root/lib/Index/ResolveLocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Index/ResolveLocation.cpp')
-rw-r--r--lib/Index/ResolveLocation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Index/ResolveLocation.cpp b/lib/Index/ResolveLocation.cpp
index b94d48e33d..d3ba8192b2 100644
--- a/lib/Index/ResolveLocation.cpp
+++ b/lib/Index/ResolveLocation.cpp
@@ -497,9 +497,12 @@ void LocResolverBase::print(Stmt *Node) {
/// \brief Returns the AST node that a source location points to.
///
-ASTLocation idx::ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc) {
+ASTLocation idx::ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc,
+ Decl *RelativeToDecl) {
if (Loc.isInvalid())
return ASTLocation();
+ if (RelativeToDecl)
+ return DeclLocResolver(Ctx, Loc).Visit(RelativeToDecl);
return DeclLocResolver(Ctx, Loc).Visit(Ctx.getTranslationUnitDecl());
}