clang 20.0.0git
Public Member Functions | Public Attributes | List of all members
clang::HeaderFileInfo Struct Reference

The preprocessor keeps track of this information for each file that is #included. More...

#include "clang/Lex/HeaderSearch.h"

Public Member Functions

 HeaderFileInfo ()
 
const IdentifierInfogetControllingMacro (ExternalPreprocessorSource *External)
 Retrieve the controlling macro for this header file, if any.
 
void mergeModuleMembership (ModuleMap::ModuleHeaderRole Role)
 Update the module membership bits based on the header role.
 

Public Attributes

unsigned IsLocallyIncluded: 1
 True if this file has been included (or imported) locally.
 
unsigned isImport: 1
 True if this is a #import'd file.
 
unsigned isPragmaOnce: 1
 True if this is a #pragma once file.
 
unsigned DirInfo: 3
 Keep track of whether this is a system header, and if so, whether it is C++ clean or not.
 
unsigned External: 1
 Whether this header file info was supplied by an external source, and has not changed since.
 
unsigned isModuleHeader: 1
 Whether this header is part of and built with a module.
 
unsigned isTextualModuleHeader: 1
 Whether this header is a textual header in a module.
 
unsigned isCompilingModuleHeader: 1
 Whether this header is part of the module that we are building, even if it doesn't build with the module.
 
unsigned Resolved: 1
 Whether this structure is considered to already have been "resolved", meaning that it was loaded from the external source.
 
unsigned IndexHeaderMapHeader: 1
 Whether this is a header inside a framework that is currently being built.
 
unsigned IsValid: 1
 Whether this file has been looked up as a header.
 
LazyIdentifierInfoPtr LazyControllingMacro
 If this file has a #ifndef XXX (or equivalent) guard that protects the entire contents of the file, this is the identifier for the macro that controls whether or not it has any effect.
 
StringRef Framework
 If this header came from a framework include, this is the name of the framework.
 

Detailed Description

The preprocessor keeps track of this information for each file that is #included.

Definition at line 59 of file HeaderSearch.h.

Constructor & Destructor Documentation

◆ HeaderFileInfo()

clang::HeaderFileInfo::HeaderFileInfo ( )
inline

Definition at line 139 of file HeaderSearch.h.

Member Function Documentation

◆ getControllingMacro()

const IdentifierInfo * HeaderFileInfo::getControllingMacro ( ExternalPreprocessorSource External)

◆ mergeModuleMembership()

void HeaderFileInfo::mergeModuleMembership ( ModuleMap::ModuleHeaderRole  Role)

Update the module membership bits based on the header role.

isModuleHeader will potentially be set, but not cleared. isTextualModuleHeader will be set or cleared based on the role update.

Definition at line 1339 of file HeaderSearch.cpp.

References clang::ModuleMap::isModular(), mergeHeaderFileInfoModuleBits(), and clang::ModuleMap::TextualHeader.

Referenced by clang::serialization::reader::HeaderFileInfoTrait::ReadData().

Member Data Documentation

◆ DirInfo

unsigned clang::HeaderFileInfo::DirInfo

Keep track of whether this is a system header, and if so, whether it is C++ clean or not.

This can be set by the include paths or by #pragma gcc system_header. This is an instance of SrcMgr::CharacteristicKind.

Definition at line 81 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::getFileDirFlavor(), clang::HeaderSearch::LookupFile(), clang::HeaderSearch::LookupSubframeworkHeader(), clang::HeaderSearch::MarkFileSystemHeader(), mergeHeaderFileInfo(), and clang::serialization::reader::HeaderFileInfoTrait::ReadData().

◆ External

unsigned clang::HeaderFileInfo::External

Whether this header file info was supplied by an external source, and has not changed since.

Definition at line 86 of file HeaderSearch.h.

Referenced by getControllingMacro(), clang::HeaderSearch::getExistingLocalFileInfo(), clang::HeaderSearch::getFileInfo(), mergeHeaderFileInfo(), and clang::serialization::reader::HeaderFileInfoTrait::ReadData().

◆ Framework

StringRef clang::HeaderFileInfo::Framework

If this header came from a framework include, this is the name of the framework.

Definition at line 137 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::LookupFile(), mergeHeaderFileInfo(), and clang::serialization::reader::HeaderFileInfoTrait::ReadData().

◆ IndexHeaderMapHeader

unsigned clang::HeaderFileInfo::IndexHeaderMapHeader

Whether this is a header inside a framework that is currently being built.

When a framework is being built, the headers have not yet been placed into the appropriate framework subdirectories, and therefore are provided via a header map. This bit indicates when this is one of those framework headers.

Definition at line 119 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::LookupFile(), mergeHeaderFileInfo(), and clang::serialization::reader::HeaderFileInfoTrait::ReadData().

◆ isCompilingModuleHeader

unsigned clang::HeaderFileInfo::isCompilingModuleHeader

Whether this header is part of the module that we are building, even if it doesn't build with the module.

i.e. this will include excluded and textual headers as well as normal headers.

Definition at line 104 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::ShouldEnterIncludeFile().

◆ isImport

unsigned clang::HeaderFileInfo::isImport

◆ IsLocallyIncluded

unsigned clang::HeaderFileInfo::IsLocallyIncluded

True if this file has been included (or imported) locally.

Definition at line 64 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::ShouldEnterIncludeFile().

◆ isModuleHeader

unsigned clang::HeaderFileInfo::isModuleHeader

Whether this header is part of and built with a module.

i.e. it is listed in a module map, and is not excluded or textual. (same meaning as ModuleMap::isModular()).

Definition at line 92 of file HeaderSearch.h.

Referenced by mergeHeaderFileInfo(), mergeHeaderFileInfoModuleBits(), moduleMembershipNeedsMerge(), and clang::HeaderSearch::ShouldEnterIncludeFile().

◆ isPragmaOnce

unsigned clang::HeaderFileInfo::isPragmaOnce

◆ isTextualModuleHeader

unsigned clang::HeaderFileInfo::isTextualModuleHeader

Whether this header is a textual header in a module.

If a header is textual in one module and normal in another module, this bit will not be set, only isModuleHeader.

Definition at line 98 of file HeaderSearch.h.

Referenced by mergeHeaderFileInfo(), mergeHeaderFileInfoModuleBits(), moduleMembershipNeedsMerge(), and clang::HeaderSearch::ShouldEnterIncludeFile().

◆ IsValid

unsigned clang::HeaderFileInfo::IsValid

◆ LazyControllingMacro

LazyIdentifierInfoPtr clang::HeaderFileInfo::LazyControllingMacro

If this file has a #ifndef XXX (or equivalent) guard that protects the entire contents of the file, this is the identifier for the macro that controls whether or not it has any effect.

Note: Most clients should use getControllingMacro() to access the controlling macro of this header, since getControllingMacro() is able to load a controlling macro from external storage.

Definition at line 133 of file HeaderSearch.h.

Referenced by getControllingMacro(), mergeHeaderFileInfo(), clang::serialization::reader::HeaderFileInfoTrait::ReadData(), and clang::HeaderSearch::SetFileControllingMacro().

◆ Resolved

unsigned clang::HeaderFileInfo::Resolved

Whether this structure is considered to already have been "resolved", meaning that it was loaded from the external source.

Definition at line 109 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::getExistingFileInfo(), and clang::HeaderSearch::getFileInfo().


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