llvm-project/clang/lib/Lex
Joel E. Denny ddde0ec1e4 [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
2019-05-21 23:51:38 +00:00
..
CMakeLists.txt PTH-- Remove feature entirely- 2018-12-04 14:34:09 +00:00
HeaderMap.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
HeaderSearch.cpp [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path 2019-04-24 09:23:31 +00:00
Lexer.cpp Replace tok::angle_string_literal with new tok::header_name. 2019-03-19 22:09:55 +00:00
LiteralSupport.cpp [CUDA][HIP] Do not diagnose use of _Float16 2019-01-29 13:20:23 +00:00
MacroArgs.cpp [Lex] Allow to consume tokens while preprocessing 2019-05-17 09:32:05 +00:00
MacroInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ModuleMap.cpp [c++2a] Add semantic support for private module fragments. 2019-04-18 21:12:54 +00:00
PPCaching.cpp [Lex] Allow to consume tokens while preprocessing 2019-05-17 09:32:05 +00:00
PPCallbacks.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PPConditionalDirectiveRecord.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PPDirectives.cpp [PragmaHandler] Expose `#pragma` location 2019-05-21 23:51:38 +00:00
PPExpressions.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PPLexerChange.cpp [Lex] Allow to consume tokens while preprocessing 2019-05-17 09:32:05 +00:00
PPMacroExpansion.cpp [Lex] Allow to consume tokens while preprocessing 2019-05-17 09:32:05 +00:00
Pragma.cpp [PragmaHandler] Expose `#pragma` location 2019-05-21 23:51:38 +00:00
PreprocessingRecord.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Preprocessor.cpp [Lex] Allow to consume tokens while preprocessing 2019-05-17 09:32:05 +00:00
PreprocessorLexer.cpp Factor out repeated code parsing and concatenating header-names from 2019-03-19 01:51:19 +00:00
ScratchBuffer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TokenConcatenation.cpp [C++20] Implement context-sensitive header-name lexing and pp-import parsing in the preprocessor. 2019-04-11 21:18:23 +00:00
TokenLexer.cpp [Lex] Allow to consume tokens while preprocessing 2019-05-17 09:32:05 +00:00
UnicodeCharSets.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00