class InclusionDirective

Declaration

class InclusionDirective : public PreprocessingDirective { /* full declaration omitted */ };

Description

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

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:207

Inherits from: PreprocessingDirective

Member Variables

private llvm::StringRef FileName
The name of the file that was included, as written in the source.
private unsigned int InQuotes
Whether the file name was in quotation marks; otherwise, it was in angle brackets.
private unsigned int Kind
This is a value of type InclusionKind.
private unsigned int ImportedModule
Whether the inclusion directive was automatically turned into a module import.
private Optional<clang::FileEntryRef> File
The file that was included.

Method Overview

  • public InclusionDirective(clang::PreprocessingRecord & PPRec, clang::InclusionDirective::InclusionKind Kind, llvm::StringRef FileName, bool InQuotes, bool ImportedModule, Optional<clang::FileEntryRef> File, clang::SourceRange Range)
  • public static bool classof(const clang::PreprocessedEntity * PE)
  • public Optional<clang::FileEntryRef> getFile() const
  • public llvm::StringRef getFileName() const
  • public clang::InclusionDirective::InclusionKind getKind() const
  • public bool importedModule() const
  • public bool wasInQuotes() const

Inherited from PreprocessingDirective:

Inherited from PreprocessedEntity:

Methods

InclusionDirective(
    clang::PreprocessingRecord& PPRec,
    clang::InclusionDirective::InclusionKind Kind,
    llvm::StringRef FileName,
    bool InQuotes,
    bool ImportedModule,
    Optional<clang::FileEntryRef> File,
    clang::SourceRange Range)

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:247

Parameters

clang::PreprocessingRecord& PPRec
clang::InclusionDirective::InclusionKind Kind
llvm::StringRef FileName
bool InQuotes
bool ImportedModule
Optional<clang::FileEntryRef> File
clang::SourceRange Range

static bool classof(
    const clang::PreprocessedEntity* PE)

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:270

Parameters

const clang::PreprocessedEntity* PE

Optional<clang::FileEntryRef> getFile() const

Description

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

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:267

llvm::StringRef getFileName() const

Description

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

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:255

clang::InclusionDirective::InclusionKind getKind()
    const

Description

Determine what kind of inclusion directive this is.

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:252

bool importedModule() const

Description

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

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:263

bool wasInQuotes() const

Description

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

Declared at: clang/include/clang/Lex/PreprocessingRecord.h:259