summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PrintPreprocessedOutput.cpp
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny.ornl@gmail.com>2019-05-21 23:51:38 +0000
committerJoel E. Denny <jdenny.ornl@gmail.com>2019-05-21 23:51:38 +0000
commitddde0ec1e47b839a2c9d1b107b5cf3c17ca2710d (patch)
tree9addb94c209bdabc550842f7699383ef47b27552 /clang/lib/Frontend/PrintPreprocessedOutput.cpp
parentb5417301917f5b38c91ca4a76c546c6467823353 (diff)
downloadbcm5719-llvm-ddde0ec1e47b839a2c9d1b107b5cf3c17ca2710d.tar.gz
bcm5719-llvm-ddde0ec1e47b839a2c9d1b107b5cf3c17ca2710d.zip
[PragmaHandler] Expose `#pragma` location
Currently, a pragma AST node's recorded location starts at the namespace token (such as `omp` in the case of OpenMP) after the `#pragma` token, and the `#pragma` location isn't available. However, the `#pragma` location can be useful when, for example, rewriting a directive using Clang's Rewrite facility. This patch makes `#pragma` locations available in any `PragmaHandler` but it doesn't yet make use of them. This patch also uses the new `struct PragmaIntroducer` to simplify `Preprocessor::HandlePragmaDirective`. It doesn't do the same for `PPCallbacks::PragmaDirective` because that changes the API documented in `clang-tools-extra/docs/pp-trace.rst`, and I'm not sure about backward compatibility guarantees there. Reviewed By: ABataev, lebedev.ri, aaron.ballman Differential Revision: https://reviews.llvm.org/D61643 llvm-svn: 361335
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r--clang/lib/Frontend/PrintPreprocessedOutput.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 720ed51c5f6..732edacffbe 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -664,7 +664,7 @@ struct UnknownPragmaHandler : public PragmaHandler {
bool RequireTokenExpansion)
: Prefix(prefix), Callbacks(callbacks),
ShouldExpandTokens(RequireTokenExpansion) {}
- void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
+ void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
Token &PragmaTok) override {
// Figure out what line we went to and insert the appropriate number of
// newline characters.
OpenPOWER on IntegriCloud