clang  6.0.0svn
Public Member Functions | List of all members
clang::PragmaNamespace Class Reference

PragmaNamespace - This PragmaHandler subdivides the namespace of pragmas, allowing hierarchical pragmas to be defined. More...

#include "clang/Lex/Pragma.h"

Inheritance diagram for clang::PragmaNamespace:
Inheritance graph
[legend]
Collaboration diagram for clang::PragmaNamespace:
Collaboration graph
[legend]

Public Member Functions

 PragmaNamespace (StringRef Name)
 
 ~PragmaNamespace () override
 
PragmaHandlerFindHandler (StringRef Name, bool IgnoreNull=true) const
 FindHandler - Check to see if there is already a handler for the specified name. More...
 
void AddPragma (PragmaHandler *Handler)
 AddPragma - Add a pragma to this namespace. More...
 
void RemovePragmaHandler (PragmaHandler *Handler)
 RemovePragmaHandler - Remove the given handler from the namespace. More...
 
bool IsEmpty ()
 
void HandlePragma (Preprocessor &PP, PragmaIntroducerKind Introducer, Token &FirstToken) override
 
PragmaNamespacegetIfNamespace () override
 getIfNamespace - If this is a namespace, return it. More...
 
- Public Member Functions inherited from clang::PragmaHandler
 PragmaHandler (StringRef name)
 
 PragmaHandler ()
 
virtual ~PragmaHandler ()
 
StringRef getName () const
 

Detailed Description

PragmaNamespace - This PragmaHandler subdivides the namespace of pragmas, allowing hierarchical pragmas to be defined.

Common examples of namespaces are "\#pragma GCC", "\#pragma STDC", and "\#pragma omp", but any namespaces may be (potentially recursively) defined.

Definition at line 89 of file Pragma.h.

Constructor & Destructor Documentation

◆ PragmaNamespace()

clang::PragmaNamespace::PragmaNamespace ( StringRef  Name)
inlineexplicit

Definition at line 95 of file Pragma.h.

◆ ~PragmaNamespace()

PragmaNamespace::~PragmaNamespace ( )
override

Definition at line 67 of file Pragma.cpp.

Member Function Documentation

◆ AddPragma()

void PragmaNamespace::AddPragma ( PragmaHandler Handler)

AddPragma - Add a pragma to this namespace.

Definition at line 82 of file Pragma.cpp.

References clang::PragmaHandler::getName().

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

◆ FindHandler()

PragmaHandler * PragmaNamespace::FindHandler ( StringRef  Name,
bool  IgnoreNull = true 
) const

FindHandler - Check to see if there is already a handler for the specified name.

If not, return the handler for the null name if it exists, otherwise return null. If IgnoreNull is true (the default) then the null handler isn't returned on failure to match.

If not, return the handler for the null identifier if it exists, otherwise return null. If IgnoreNull is true (the default) then the null handler isn't returned on failure to match.

Definition at line 75 of file Pragma.cpp.

Referenced by clang::Preprocessor::AddPragmaHandler(), and clang::Preprocessor::IgnorePragmas().

◆ getIfNamespace()

PragmaNamespace* clang::PragmaNamespace::getIfNamespace ( )
inlineoverridevirtual

getIfNamespace - If this is a namespace, return it.

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

Reimplemented from clang::PragmaHandler.

Definition at line 120 of file Pragma.h.

Referenced by clang::Preprocessor::AddPragmaHandler(), and clang::Preprocessor::IgnorePragmas().

◆ HandlePragma()

void PragmaNamespace::HandlePragma ( Preprocessor PP,
PragmaIntroducerKind  Introducer,
Token FirstToken 
)
overridevirtual

◆ IsEmpty()

bool clang::PragmaNamespace::IsEmpty ( )
inline

Definition at line 113 of file Pragma.h.

References clang::PragmaHandler::HandlePragma().

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

◆ RemovePragmaHandler()

void PragmaNamespace::RemovePragmaHandler ( PragmaHandler Handler)

RemovePragmaHandler - Remove the given handler from the namespace.

Definition at line 88 of file Pragma.cpp.

References clang::PragmaHandler::getName().

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


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