gen_compile_commands: move directory walk to a generator function
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 22 Aug 2020 14:56:14 +0000 (23:56 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 26 Aug 2020 15:44:33 +0000 (00:44 +0900)
commitfc2cb22ec61c1a537337cd0eba458863564a0e1f
treee537e1a977a50cb758f4f0da81ba979e03b5650e
parent6fca36f1d82ad5bc385187f0aed93bbaefaa2172
gen_compile_commands: move directory walk to a generator function

Currently, this script walks under the specified directory (default to
the current directory), then parses all .cmd files found.

Split it into a separate helper function because the next commit will
add more helpers to pick up .cmd files associated with given file(s).

There is no point to build and return a huge list at once. I used a
generator so it works in the for-loop with less memory.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
scripts/gen_compile_commands.py