[clangd] Add a helper for extracting nonlocal decls in a FunctionDecl

Summary:
To be used by define-inline code action to determine whether the
function/method body will still be valid in another context.

Traverses clang-ast to find all decl nodes under the function decl and stores
the non-local ones.

Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67748

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@372948 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed