clang  6.0.0svn
Public Member Functions | List of all members
clang::PragmaHandler Class Referenceabstract

PragmaHandler - Instances of this interface defined to handle the various pragmas that the language front-end uses. More...

#include "clang/Lex/Pragma.h"

Inheritance diagram for clang::PragmaHandler:
Inheritance graph
[legend]

Public Member Functions

 PragmaHandler ()=default
 
 PragmaHandler (StringRef name)
 
virtual ~PragmaHandler ()
 
StringRef getName () const
 
virtual void HandlePragma (Preprocessor &PP, PragmaIntroducerKind Introducer, Token &FirstToken)=0
 
virtual PragmaNamespacegetIfNamespace ()
 getIfNamespace - If this is a namespace, return it. More...
 

Detailed Description

PragmaHandler - Instances of this interface defined to handle the various pragmas that the language front-end uses.

Each handler optionally has a name (e.g. "pack") and the HandlePragma method is invoked when a pragma with that identifier is found. If a handler does not match any of the declared pragmas the handler with a null identifier is invoked, if it exists.

Note that the PragmaNamespace class can be used to subdivide pragmas, e.g. we treat "\#pragma STDC" and "\#pragma GCC" as namespaces that contain other pragmas.

Definition at line 59 of file Pragma.h.

Constructor & Destructor Documentation

◆ PragmaHandler() [1/2]

clang::PragmaHandler::PragmaHandler ( )
default

◆ PragmaHandler() [2/2]

clang::PragmaHandler::PragmaHandler ( StringRef  name)
inlineexplicit

Definition at line 64 of file Pragma.h.

References ~PragmaHandler().

◆ ~PragmaHandler()

PragmaHandler::~PragmaHandler ( )
virtualdefault

Referenced by PragmaHandler().

Member Function Documentation

◆ getIfNamespace()

virtual PragmaNamespace* clang::PragmaHandler::getIfNamespace ( )
inlinevirtual

getIfNamespace - If this is a namespace, return it.

This is equivalent to using a dynamic_cast, but doesn't require RTTI.

Reimplemented in clang::PragmaNamespace.

Definition at line 73 of file Pragma.h.

Referenced by clang::Preprocessor::RemovePragmaHandler().

◆ getName()

StringRef clang::PragmaHandler::getName ( ) const
inline

◆ HandlePragma()

virtual void clang::PragmaHandler::HandlePragma ( Preprocessor PP,
PragmaIntroducerKind  Introducer,
Token FirstToken 
)
pure virtual

The documentation for this class was generated from the following files: