13#ifndef LLVM_CLANG_LEX_PRAGMA_H
14#define LLVM_CLANG_LEX_PRAGMA_H
18#include "llvm/ADT/StringMap.h"
19#include "llvm/ADT/StringRef.h"
73 StringRef
getName()
const {
return Name; }
75 Token &FirstToken) = 0;
89 Token &FirstToken)
override;
99 llvm::StringMap<std::unique_ptr<PragmaHandler>> Handlers;
109 bool IgnoreNull =
true)
const;
118 bool IsEmpty()
const {
return Handlers.empty(); }
121 Token &Tok)
override;
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
EmptyPragmaHandler - A pragma handler which takes no action, which can be used to ignore particular p...
void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer, Token &FirstToken) override
PragmaHandler - Instances of this interface defined to handle the various pragmas that the language f...
StringRef getName() const
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer, Token &FirstToken)=0
PragmaHandler(StringRef name)
virtual PragmaNamespace * getIfNamespace()
getIfNamespace - If this is a namespace, return it.
PragmaNamespace - This PragmaHandler subdivides the namespace of pragmas, allowing hierarchical pragm...
void AddPragma(PragmaHandler *Handler)
AddPragma - Add a pragma to this namespace.
PragmaHandler * FindHandler(StringRef Name, bool IgnoreNull=true) const
FindHandler - Check to see if there is already a handler for the specified name.
void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer, Token &Tok) override
void RemovePragmaHandler(PragmaHandler *Handler)
RemovePragmaHandler - Remove the given handler from the namespace.
PragmaNamespace * getIfNamespace() override
getIfNamespace - If this is a namespace, return it.
PragmaNamespace(StringRef Name)
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Encodes a location in the source.
Token - This structure provides full information about a lexed token.
The JSON file list parser is used to communicate input to InstallAPI.
PragmaIntroducerKind
Describes how the pragma was introduced, e.g., with #pragma, _Pragma, or __pragma.
@ PIK_HashPragma
The pragma was introduced via #pragma.
@ PIK__Pragma
The pragma was introduced via the C99 _Pragma(string-literal).
@ PIK___pragma
The pragma was introduced via the Microsoft __pragma(token-string).
void prepare_PragmaString(SmallVectorImpl< char > &StrVal)
Destringize a _Pragma("") string according to C11 6.10.9.1: "The string literal is destringized by de...
Describes how and where the pragma was introduced.
PragmaIntroducerKind Kind