[Target] Move function definitions out of anonymous namespaces (#244814)
The coding standards say the following:
> Make anonymous namespaces as small as possible, and only use them for
> class declarations.
This also makes these files compliant with the
llvm-prefer-static-over-anonymous-namespaces clang-tidy check.