Update the hasFlag check to account for an Option's groups to better
match how the option parsing logic works, and instead of checking if a
group has include/exclude flags just check if there are any visible
options in it.
This cleans up some the empty sections that are currently emitted in
clang's option docs.
For new functions, consider using static for internal linkage functions even if they are surrounded by an anonymous namespace, per https://llvm.org/docs/CodingStandards.html#anonymous-namespaces