clang  6.0.0svn
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]
Collaboration diagram for clang::InclusionDirective:
Collaboration 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, const FileEntry *File, SourceRange Range)
 
InclusionKind getKind () const
 Determine what kind of inclusion directive this is. More...
 
StringRef getFileName () const
 Retrieve the included file name as it was written in the source. More...
 
bool wasInQuotes () const
 Determine whether the included file name was written in quotes; otherwise, it was written in angle brackets. More...
 
bool importedModule () const
 Determine whether the inclusion directive was automatically turned into a module import. More...
 
const FileEntrygetFile () const
 Retrieve the file entry for the actual file that was included by this directive. More...
 
- 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. More...
 
SourceRange getSourceRange () const LLVM_READONLY
 Retrieve the source range that covers this entire preprocessed entity. More...
 
bool isInvalid () const
 Returns true if there was a problem loading the preprocessed entity. More...
 
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 208 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 212 of file PreprocessingRecord.h.

Constructor & Destructor Documentation

◆ InclusionDirective()

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

Definition at line 43 of file PreprocessingRecord.cpp.

Member Function Documentation

◆ classof()

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

◆ getFile()

const FileEntry* 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.

◆ 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.

◆ 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: