summaryrefslogtreecommitdiff
path: root/examples
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
commit6333880aae00e07c175e5672d8dfe468a5032f75 (patch)
tree18a61169f0c3928c29fda247f1b94385b609a27f /examples
parentf71dcea071a1be41e27d816b89425ba5bd6c7c59 (diff)
downloadclang-6333880aae00e07c175e5672d8dfe468a5032f75.tar.gz
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361335 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/AnnotateFunctions/AnnotateFunctions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/AnnotateFunctions/AnnotateFunctions.cpp b/examples/AnnotateFunctions/AnnotateFunctions.cpp
index 1ed7e9eda4..96eb78eb17 100644
--- a/examples/AnnotateFunctions/AnnotateFunctions.cpp
+++ b/examples/AnnotateFunctions/AnnotateFunctions.cpp
@@ -58,7 +58,7 @@ class PragmaAnnotateHandler : public PragmaHandler {
public:
PragmaAnnotateHandler() : PragmaHandler("enable_annotate") { }
- void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
+ void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
Token &PragmaTok) override {
Token Tok;