Currently, an OpenMP AST node's recorded location starts at the `omp`
token after the `#pragma` token, and the `#pragma` location isn't
available anywhere that I have found. However, the `#pragma` location
can be useful when, for example, rewriting a directive using Clang's
This patch makes `#pragma` locations available in any `PragmaHandler`.
However, this patch is incomplete as it does not actually use those
locations. I'd like to extend the OpenMP implementation to use it,
but I see two possible approaches, and I need feedback to choose one:
1. Extend `PragmaOpenMPHandler` to set the location of `tok::annot_pragma_openmp` to the `#pragma` location so that the `#pragma` location then becomes the start location of the OpenMP AST node. The drawback here is that locations in many tests, especially `-ast-dump` tests, will need to be updated, and it's not clear to me if any external AST user depends on the existing locations.
2. Extend `PragmaOpenMPHandler` to insert a new token, perhaps named `tok::annot_pragma_openmp_intro`, before `tok::annot_pragma_openmp` and store both their locations in each OpenMP AST node. The new location would be accessed by new member functions so that users of the old location wouldn't see a change. The drawback here is that a lot of the OpenMP AST node construction code will need to be updated.