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

RAII object used to inform the actions that we're currently parsing a declaration. More...

#include "clang/Parse/RAIIObjectsForParser.h"

Public Types

enum  NoParent_t { NoParent }
 

Public Member Functions

 ParsingDeclRAIIObject (Parser &P, NoParent_t _)
 
 ParsingDeclRAIIObject (Parser &P, const sema::DelayedDiagnosticPool *parentPool)
 Creates a RAII object whose pool is optionally parented by another. More...
 
 ParsingDeclRAIIObject (Parser &P, ParsingDeclRAIIObject *other)
 Creates a RAII object and, optionally, initialize its diagnostics pool by stealing the diagnostics from another RAII object (which is assumed to be the current top pool). More...
 
 ~ParsingDeclRAIIObject ()
 
sema::DelayedDiagnosticPoolgetDelayedDiagnosticPool ()
 
const sema::DelayedDiagnosticPoolgetDelayedDiagnosticPool () const
 
void reset ()
 Resets the RAII object for a new declaration. More...
 
void abort ()
 Signals that the context was completed without an appropriate declaration being parsed. More...
 
void complete (Decl *D)
 
void abortAndRemember ()
 Unregister this object from Sema, but remember all the diagnostics that were emitted into it. More...
 

Detailed Description

RAII object used to inform the actions that we're currently parsing a declaration.

This is active when parsing a variable's initializer, but not when parsing the body of a class or function definition.

Definition at line 91 of file RAIIObjectsForParser.h.

Member Enumeration Documentation

◆ NoParent_t

Enumerator
NoParent 

Definition at line 101 of file RAIIObjectsForParser.h.

Constructor & Destructor Documentation

◆ ParsingDeclRAIIObject() [1/3]

clang::ParsingDeclRAIIObject::ParsingDeclRAIIObject ( Parser P,
NoParent_t  _ 
)
inline

Definition at line 102 of file RAIIObjectsForParser.h.

◆ ParsingDeclRAIIObject() [2/3]

clang::ParsingDeclRAIIObject::ParsingDeclRAIIObject ( Parser P,
const sema::DelayedDiagnosticPool parentPool 
)
inline

Creates a RAII object whose pool is optionally parented by another.

Definition at line 108 of file RAIIObjectsForParser.h.

◆ ParsingDeclRAIIObject() [3/3]

clang::ParsingDeclRAIIObject::ParsingDeclRAIIObject ( Parser P,
ParsingDeclRAIIObject other 
)
inline

Creates a RAII object and, optionally, initialize its diagnostics pool by stealing the diagnostics from another RAII object (which is assumed to be the current top pool).

Definition at line 117 of file RAIIObjectsForParser.h.

References abort(), and clang::sema::DelayedDiagnosticPool::steal().

◆ ~ParsingDeclRAIIObject()

clang::ParsingDeclRAIIObject::~ParsingDeclRAIIObject ( )
inline

Definition at line 127 of file RAIIObjectsForParser.h.

Member Function Documentation

◆ abort()

void clang::ParsingDeclRAIIObject::abort ( )
inline

Signals that the context was completed without an appropriate declaration being parsed.

Definition at line 146 of file RAIIObjectsForParser.h.

Referenced by clang::ParsingDeclSpec::abort(), and ParsingDeclRAIIObject().

◆ abortAndRemember()

void clang::ParsingDeclRAIIObject::abortAndRemember ( )
inline

Unregister this object from Sema, but remember all the diagnostics that were emitted into it.

Definition at line 157 of file RAIIObjectsForParser.h.

References clang::Sema::PopParsingDeclaration(), and clang::Sema::PushParsingDeclaration().

◆ complete()

void clang::ParsingDeclRAIIObject::complete ( Decl D)
inline

◆ getDelayedDiagnosticPool() [1/2]

sema::DelayedDiagnosticPool& clang::ParsingDeclRAIIObject::getDelayedDiagnosticPool ( )
inline

◆ getDelayedDiagnosticPool() [2/2]

const sema::DelayedDiagnosticPool& clang::ParsingDeclRAIIObject::getDelayedDiagnosticPool ( ) const
inline

Definition at line 134 of file RAIIObjectsForParser.h.

◆ reset()

void clang::ParsingDeclRAIIObject::reset ( )
inline

Resets the RAII object for a new declaration.

Definition at line 139 of file RAIIObjectsForParser.h.

Referenced by clang::ParsingDeclarator::clear().


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