clang API Documentation

Classes | Public Member Functions | Friends
clang::PreprocessingRecord Class Reference

A record of the steps taken while preprocessing a source file, including the various preprocessing directives processed, macros expanded, etc. More...

#include <PreprocessingRecord.h>

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

List of all members.

Classes

class  iterator
class  PPEntityID
 Global (loaded or local) ID for a preprocessed entity. Negative values are used to indicate preprocessed entities loaded from the external source while non-negative values are used to indicate preprocessed entities introduced by the current preprocessor. Value -1 corresponds to element 0 in the loaded entities vector, value -2 corresponds to element 1 in the loaded entities vector, etc. Value 0 is an invalid value, the index to local entities is 1-based, value 1 corresponds to element 0 in the local entities vector, value 2 corresponds to element 1 in the local entities vector, etc.

Public Member Functions

 PreprocessingRecord (SourceManager &SM)
 Construct a new preprocessing record.
void * Allocate (unsigned Size, unsigned Align=8)
 Allocate memory in the preprocessing record.
void Deallocate (void *Ptr)
 Deallocate memory in the preprocessing record.
size_t getTotalMemory () const
SourceManagergetSourceManager () const
iterator begin ()
 Begin iterator for all preprocessed entities.
iterator end ()
 End iterator for all preprocessed entities.
iterator local_begin ()
 Begin iterator for local, non-loaded, preprocessed entities.
iterator local_end ()
 End iterator for local, non-loaded, preprocessed entities.
std::pair< iterator, iteratorgetIteratorsForLoadedRange (unsigned start, unsigned count)
 begin/end iterator pair for the given range of loaded preprocessed entities.
std::pair< iterator, iteratorgetPreprocessedEntitiesInRange (SourceRange R)
 Returns a pair of [Begin, End) iterators of preprocessed entities that source range R encompasses.
bool isEntityInFileID (iterator PPEI, FileID FID)
 Returns true if the preprocessed entity that PPEI iterator points to is coming from the file FID.
PPEntityID addPreprocessedEntity (PreprocessedEntity *Entity)
 Add a new preprocessed entity to this record.
void SetExternalSource (ExternalPreprocessingRecordSource &Source)
 Set the external source for preprocessed entities.
ExternalPreprocessingRecordSourcegetExternalSource () const
 Retrieve the external source for preprocessed entities.
MacroDefinitionfindMacroDefinition (const MacroInfo *MI)
 Retrieve the macro definition that corresponds to the given MacroInfo.
const std::vector< SourceRange > & getSkippedRanges () const
 Retrieve all ranges that got skipped while preprocessing.

Friends

class iterator
class ASTReader
class ASTWriter

Detailed Description

A record of the steps taken while preprocessing a source file, including the various preprocessing directives processed, macros expanded, etc.

Definition at line 290 of file PreprocessingRecord.h.


Constructor & Destructor Documentation

Construct a new preprocessing record.

Definition at line 41 of file PreprocessingRecord.cpp.


Member Function Documentation

PreprocessingRecord::PPEntityID PreprocessingRecord::addPreprocessedEntity ( PreprocessedEntity Entity)
void* clang::PreprocessingRecord::Allocate ( unsigned  Size,
unsigned  Align = 8 
) [inline]

Allocate memory in the preprocessing record.

Definition at line 370 of file PreprocessingRecord.h.

Referenced by clang::InclusionDirective::InclusionDirective().

Begin iterator for all preprocessed entities.

Definition at line 502 of file PreprocessingRecord.h.

void clang::PreprocessingRecord::Deallocate ( void *  Ptr) [inline]

Deallocate memory in the preprocessing record.

Definition at line 375 of file PreprocessingRecord.h.

Referenced by operator delete().

End iterator for all preprocessed entities.

Definition at line 507 of file PreprocessingRecord.h.

Retrieve the macro definition that corresponds to the given MacroInfo.

Definition at line 360 of file PreprocessingRecord.cpp.

Retrieve the external source for preprocessed entities.

Definition at line 555 of file PreprocessingRecord.h.

begin/end iterator pair for the given range of loaded preprocessed entities.

Definition at line 524 of file PreprocessingRecord.h.

Returns a pair of [Begin, End) iterators of preprocessed entities that source range R encompasses.

Returns a pair of [Begin, End) iterators of preprocessed entities that source range Range encompasses.

Parameters:
Rthe range to look for preprocessed entities.

Definition at line 49 of file PreprocessingRecord.cpp.

References clang::SourceRange::isInvalid(), iterator, and Range.

const std::vector<SourceRange>& clang::PreprocessingRecord::getSkippedRanges ( ) const [inline]

Retrieve all ranges that got skipped while preprocessing.

Definition at line 564 of file PreprocessingRecord.h.

Definition at line 379 of file PreprocessingRecord.h.

References SourceMgr.

Definition at line 485 of file PreprocessingRecord.cpp.

Returns true if the preprocessed entity that PPEI iterator points to is coming from the file FID.

Returns true if the preprocessed entity that.

Can be used to avoid implicit deserializations of preallocated preprocessed entities if we only care about entities of a specific file and not from files #included in the range given at

See also:
getPreprocessedEntitiesInRange.
  • PPEI iterator points to is coming from the file
  • FID.

Can be used to avoid implicit deserializations of preallocated preprocessed entities if we only care about entities of a specific file and not from files #included in the range given at

See also:
getPreprocessedEntitiesInRange.

Definition at line 89 of file PreprocessingRecord.cpp.

References clang::FileID::isInvalid(), isPreprocessedEntityIfInFileID(), and clang::ExternalPreprocessingRecordSource::isPreprocessedEntityInFileID().

Begin iterator for local, non-loaded, preprocessed entities.

Definition at line 512 of file PreprocessingRecord.h.

End iterator for local, non-loaded, preprocessed entities.

Definition at line 517 of file PreprocessingRecord.h.

Set the external source for preprocessed entities.

Definition at line 308 of file PreprocessingRecord.cpp.


Friends And Related Function Documentation

friend class ASTReader [friend]

Definition at line 601 of file PreprocessingRecord.h.

friend class ASTWriter [friend]

Definition at line 602 of file PreprocessingRecord.h.

friend class iterator [friend]

Definition at line 499 of file PreprocessingRecord.h.

Referenced by getPreprocessedEntitiesInRange().


Member Data Documentation

Definition at line 595 of file PreprocessingRecord.h.

Referenced by getPreprocessedEntitiesInRange().

Definition at line 596 of file PreprocessingRecord.h.


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