clang  6.0.0svn
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"

Collaboration diagram for clang::HeaderFileInfo:
Collaboration graph
[legend]

Public Member Functions

 HeaderFileInfo ()
 
const IdentifierInfogetControllingMacro (ExternalPreprocessorSource *External)
 Retrieve the controlling macro for this header file, if any. More...
 
bool isNonDefault () const
 Determine whether this is a non-default header file info, e.g., it corresponds to an actual header we've included or tried to include. More...
 

Public Attributes

unsigned isImport: 1
 True if this is a #import'd or #pragma once file. More...
 
unsigned isPragmaOnce: 1
 True if this is a #pragma once file. More...
 
unsigned DirInfo: 3
 DirInfo - Keep track of whether this is a system header, and if so, whether it is C++ clean or not. More...
 
unsigned External: 1
 Whether this header file info was supplied by an external source, and has not changed since. More...
 
unsigned isModuleHeader: 1
 Whether this header is part of a module. More...
 
unsigned isCompilingModuleHeader: 1
 Whether this header is part of the module that we are building. More...
 
unsigned Resolved: 1
 Whether this structure is considered to already have been "resolved", meaning that it was loaded from the external source. More...
 
unsigned IndexHeaderMapHeader: 1
 Whether this is a header inside a framework that is currently being built. More...
 
unsigned IsValid: 1
 Whether this file has been looked up as a header. More...
 
unsigned short NumIncludes = 0
 The number of times the file has been included already. More...
 
unsigned ControllingMacroID = 0
 The ID number of the controlling macro. More...
 
const IdentifierInfoControllingMacro = nullptr
 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. More...
 
StringRef Framework
 If this header came from a framework include, this is the name of the framework. More...
 

Detailed Description

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

Definition at line 51 of file HeaderSearch.h.

Constructor & Destructor Documentation

◆ HeaderFileInfo()

clang::HeaderFileInfo::HeaderFileInfo ( )
inline

Definition at line 114 of file HeaderSearch.h.

References External, and getControllingMacro().

Member Function Documentation

◆ getControllingMacro()

const IdentifierInfo * HeaderFileInfo::getControllingMacro ( ExternalPreprocessorSource External)

◆ isNonDefault()

bool clang::HeaderFileInfo::isNonDefault ( ) const
inline

Determine whether this is a non-default header file info, e.g., it corresponds to an actual header we've included or tried to include.

Definition at line 126 of file HeaderSearch.h.

References ControllingMacroID, isImport, and isPragmaOnce.

Member Data Documentation

◆ ControllingMacro

const IdentifierInfo* clang::HeaderFileInfo::ControllingMacro = nullptr

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 108 of file HeaderSearch.h.

Referenced by getControllingMacro(), mergeHeaderFileInfo(), and clang::HeaderSearch::SetFileControllingMacro().

◆ ControllingMacroID

unsigned clang::HeaderFileInfo::ControllingMacroID = 0

The ID number of the controlling macro.

This ID number will be non-zero when there is a controlling macro whose IdentifierInfo may not yet have been loaded from external storage.

Definition at line 98 of file HeaderSearch.h.

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

◆ DirInfo

unsigned clang::HeaderFileInfo::DirInfo

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 62 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::LookupFile(), clang::HeaderSearch::LookupSubframeworkHeader(), 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 66 of file HeaderSearch.h.

Referenced by clang::HeaderSearch::getExistingFileInfo(), clang::HeaderSearch::getFileInfo(), HeaderFileInfo(), 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 112 of file HeaderSearch.h.

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

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

Definition at line 72 of file HeaderSearch.h.

Referenced by CreateSLocExpansionAbbrev(), and clang::HeaderSearch::ShouldEnterIncludeFile().

◆ isImport

unsigned clang::HeaderFileInfo::isImport

◆ isModuleHeader

unsigned clang::HeaderFileInfo::isModuleHeader

◆ isPragmaOnce

unsigned clang::HeaderFileInfo::isPragmaOnce

◆ IsValid

unsigned clang::HeaderFileInfo::IsValid

◆ NumIncludes

unsigned short clang::HeaderFileInfo::NumIncludes = 0

The number of times the file has been included already.

Definition at line 91 of file HeaderSearch.h.

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

◆ 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 76 of file HeaderSearch.h.

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


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