clang 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::InclusionDirective Class Reference

Record the location of an inclusion directive, such as an #include or #import statement. More...

#include "clang/Lex/PreprocessingRecord.h"

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

Public Types

enum  InclusionKind { Include , Import , IncludeNext , IncludeMacros }
 The kind of inclusion directives known to the preprocessor. More...
 
- Public Types inherited from clang::PreprocessedEntity
enum  EntityKind {
  InvalidKind , MacroExpansionKind , MacroDefinitionKind , InclusionDirectiveKind ,
  FirstPreprocessingDirective = MacroDefinitionKind , LastPreprocessingDirective = InclusionDirectiveKind
}
 The kind of preprocessed entity an object describes. More...
 

Public Member Functions

 InclusionDirective (PreprocessingRecord &PPRec, InclusionKind Kind, StringRef FileName, bool InQuotes, bool ImportedModule, OptionalFileEntryRef File, SourceRange Range)
 
InclusionKind getKind () const
 Determine what kind of inclusion directive this is.
 
StringRef getFileName () const
 Retrieve the included file name as it was written in the source.
 
bool wasInQuotes () const
 Determine whether the included file name was written in quotes; otherwise, it was written in angle brackets.
 
bool importedModule () const
 Determine whether the inclusion directive was automatically turned into a module import.
 
OptionalFileEntryRef getFile () const
 Retrieve the file entry for the actual file that was included by this directive.
 
- Public Member Functions inherited from clang::PreprocessingDirective
 PreprocessingDirective (EntityKind Kind, SourceRange Range)
 
- Public Member Functions inherited from clang::PreprocessedEntity
EntityKind getKind () const
 Retrieve the kind of preprocessed entity stored in this object.
 
SourceRange getSourceRange () const LLVM_READONLY
 Retrieve the source range that covers this entire preprocessed entity.
 
bool isInvalid () const
 Returns true if there was a problem loading the preprocessed entity.
 
void * operator new (size_t bytes, PreprocessingRecord &PR, unsigned alignment=8) noexcept
 
void * operator new (size_t bytes, void *mem) noexcept
 
void operator delete (void *ptr, PreprocessingRecord &PR, unsigned alignment) noexcept
 
void operator delete (void *, std::size_t) noexcept
 
void operator delete (void *, void *) noexcept
 

Static Public Member Functions

static bool classof (const PreprocessedEntity *PE)
 
- Static Public Member Functions inherited from clang::PreprocessingDirective
static bool classof (const PreprocessedEntity *PD)
 

Additional Inherited Members

- Protected Member Functions inherited from clang::PreprocessedEntity
 PreprocessedEntity (EntityKind Kind, SourceRange Range)
 

Detailed Description

Record the location of an inclusion directive, such as an #include or #import statement.

Definition at line 206 of file PreprocessingRecord.h.

Member Enumeration Documentation

◆ InclusionKind

The kind of inclusion directives known to the preprocessor.

Enumerator
Include 

An #include directive.

Import 

An Objective-C #import directive.

IncludeNext 

A GNU #include_next directive.

IncludeMacros 

A Clang #__include_macros directive.

Definition at line 210 of file PreprocessingRecord.h.

Constructor & Destructor Documentation

◆ InclusionDirective()

InclusionDirective::InclusionDirective ( PreprocessingRecord PPRec,
InclusionKind  Kind,
StringRef  FileName,
bool  InQuotes,
bool  ImportedModule,
OptionalFileEntryRef  File,
SourceRange  Range 
)

Member Function Documentation

◆ classof()

static bool clang::InclusionDirective::classof ( const PreprocessedEntity PE)
inlinestatic

◆ getFile()

OptionalFileEntryRef clang::InclusionDirective::getFile ( ) const
inline

Retrieve the file entry for the actual file that was included by this directive.

Definition at line 269 of file PreprocessingRecord.h.

References clang::File.

◆ getFileName()

StringRef clang::InclusionDirective::getFileName ( ) const
inline

Retrieve the included file name as it was written in the source.

Definition at line 257 of file PreprocessingRecord.h.

References clang::FileName.

◆ getKind()

InclusionKind clang::InclusionDirective::getKind ( ) const
inline

Determine what kind of inclusion directive this is.

Definition at line 254 of file PreprocessingRecord.h.

◆ importedModule()

bool clang::InclusionDirective::importedModule ( ) const
inline

Determine whether the inclusion directive was automatically turned into a module import.

Definition at line 265 of file PreprocessingRecord.h.

◆ wasInQuotes()

bool clang::InclusionDirective::wasInQuotes ( ) const
inline

Determine whether the included file name was written in quotes; otherwise, it was written in angle brackets.

Definition at line 261 of file PreprocessingRecord.h.


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