clang 20.0.0git
Public Member Functions | Friends | List of all members
clang::PreprocessingRecord::iterator Class Reference

Iteration over the preprocessed entities. More...

#include "clang/Lex/PreprocessingRecord.h"

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

Public Member Functions

 iterator ()
 
PreprocessedEntityoperator* () const
 
PreprocessedEntityoperator-> () const
 

Friends

class PreprocessingRecord
 

Detailed Description

Iteration over the preprocessed entities.

In a complete iteration, the iterator walks the range [-M, N), where 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. However, to provide iteration in source order (for, e.g., chained precompiled headers), dereferencing the iterator flips the negative values (corresponding to loaded entities), so that position -M corresponds to element 0 in the loaded entities vector, position -M+1 corresponds to element 1 in the loaded entities vector, etc. This gives us a reasonably efficient, source-order walk.

We define this as a wrapping iterator around an int. The iterator_adaptor_base class forwards the iterator methods to basic integer arithmetic.

Definition at line 430 of file PreprocessingRecord.h.

Constructor & Destructor Documentation

◆ iterator()

clang::PreprocessingRecord::iterator::iterator ( )
inline

Definition at line 442 of file PreprocessingRecord.h.

Member Function Documentation

◆ operator*()

PreprocessedEntity * clang::PreprocessingRecord::iterator::operator* ( ) const
inline

Definition at line 444 of file PreprocessingRecord.h.

References ID.

◆ operator->()

PreprocessedEntity * clang::PreprocessingRecord::iterator::operator-> ( ) const
inline

Definition at line 451 of file PreprocessingRecord.h.

Friends And Related Function Documentation

◆ PreprocessingRecord

friend class PreprocessingRecord
friend

Definition at line 434 of file PreprocessingRecord.h.


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