[PATCH] D61509: [PragmaHandler] Expose `#pragma` location

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 09:04:52 PDT 2019


jdenny updated this revision to Diff 198488.
jdenny retitled this revision from "[PragmaHandler][OpenMP] Expose `#pragma` location" to "[PragmaHandler] Expose `#pragma` location".
jdenny edited the summary of this revision.
jdenny set the repository for this revision to rG LLVM Github Monorepo.
jdenny added a comment.

As suggested, I've created a `struct PragmaIntroducer` and I've reduced this patch not to include the OpenMP changes.  I'll add a new patch with the OpenMP changes soon.

There are a few additional changes here reviewers might want to check out:

- This time I noticed that `clang/docs/ClangPlugins.rst` and `clang/examples/AnnotateFunctions` need to be updated for the change to `PragmaHandler` parameters, so I did that.  Does that represent an important break in backward compatibility?

- I've also used `PragmaIntroducer` to simplify `clang::Preprocessor::HandlePragmaDirective`, which already accepted a `SourceLocation` and `PragmaIntroducerKind` before any of my patches.

- I didn't do the same for `clang::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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61509/new/

https://reviews.llvm.org/D61509

Files:
  clang/docs/ClangPlugins.rst
  clang/examples/AnnotateFunctions/AnnotateFunctions.cpp
  clang/include/clang/Lex/Pragma.h
  clang/include/clang/Lex/Preprocessor.h
  clang/lib/Frontend/PrintPreprocessedOutput.cpp
  clang/lib/Lex/PPDirectives.cpp
  clang/lib/Lex/Pragma.cpp
  clang/lib/Parse/ParsePragma.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61509.198488.patch
Type: text/x-patch
Size: 37359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190507/db0b9774/attachment-0001.bin>


More information about the cfe-commits mailing list