[Clangd] Ensure children are always RootStmt in ExtractFunction (Fixes #153)

Summary:
We weren't always checking if children are RootStmts in ExtractFunction.

For `void f([[int a]]);`, the ParmVarDecl appeared as a RootStmt since
we didn't perform the check and ended up being casted to a (null) Stmt.

Reviewers: sammccall, kadircet

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

Tags: #clang

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

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