14 #ifndef LLVM_CLANG_LEX_PRAGMA_H
15 #define LLVM_CLANG_LEX_PRAGMA_H
18 #include "llvm/ADT/StringMap.h"
19 #include "llvm/ADT/StringRef.h"
26 class PragmaNamespace;
66 StringRef
getName()
const {
return Name; }
68 Token &FirstToken) = 0;
82 Token &FirstToken)
override;
93 llvm::StringMap<PragmaHandler*> Handlers;
103 bool IgnoreNull =
true)
const;
114 return Handlers.empty();
118 Token &FirstToken)
override;
StringRef getName() const
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, Token &FirstToken)=0
The pragma was introduced via the Microsoft __pragma(token-string).
The pragma was introduced via the C99 _Pragma(string-literal).
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, Token &FirstToken) override
EmptyPragmaHandler(StringRef Name=StringRef())
void AddPragma(PragmaHandler *Handler)
AddPragma - Add a pragma to this namespace.
Token - This structure provides full information about a lexed token.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
PragmaIntroducerKind
Describes how the pragma was introduced, e.g., with #pragma, _Pragma, or __pragma.
EmptyPragmaHandler - A pragma handler which takes no action, which can be used to ignore particular p...
PragmaNamespace * getIfNamespace() override
getIfNamespace - If this is a namespace, return it.
PragmaHandler * FindHandler(StringRef Name, bool IgnoreNull=true) const
FindHandler - Check to see if there is already a handler for the specified name.
The pragma was introduced via #pragma.
~PragmaNamespace() override
virtual PragmaNamespace * getIfNamespace()
getIfNamespace - If this is a namespace, return it.
PragmaHandler - Instances of this interface defined to handle the various pragmas that the language f...
void RemovePragmaHandler(PragmaHandler *Handler)
RemovePragmaHandler - Remove the given handler from the namespace.
PragmaNamespace - This PragmaHandler subdivides the namespace of pragmas, allowing hierarchical pragm...
void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, Token &FirstToken) override
PragmaNamespace(StringRef Name)
PragmaHandler(StringRef name)
Engages in a tight little dance with the lexer to efficiently preprocess tokens.