class FileInfo
Declaration
class FileInfo { /* full declaration omitted */ };
Description
Information about a FileID, basically just the logical file that it represents and include stack information. Each FileInfo has include stack information, indicating where it came from. This information encodes the # include chain that a token was expanded from. The main include file has an invalid IncludeLoc. FileInfo should not grow larger than ExpansionInfo. Doing so will cause memory to bloat in compilations with many unloaded macro expansions, since the two data structurs are stored in a union in SLocEntry. Extra fields should instead go in "ContentCache *", which stores file contents and other bits on the side.
Declared at: clang/include/clang/Basic/SourceManager.h:283
Member Variables
- private clang::SourceLocation IncludeLoc
- This is an invalid SLOC for the main file (top of the # include chain).
- private unsigned int NumCreatedFIDs
- Zero means the preprocessor didn't provide such info for this SLocEntry.
- private unsigned int HasLineDirectives
- Whether this FileInfo has any # line directives.
- private llvm::PointerIntPair<const ContentCache*, 3, CharacteristicKind> ContentAndKind
- The content cache and the characteristic of the file.
Method Overview
- public static clang::SrcMgr::FileInfo get(clang::SourceLocation IL, clang::SrcMgr::ContentCache & Con, clang::SrcMgr::CharacteristicKind FileCharacter, llvm::StringRef Filename)
- public const clang::SrcMgr::ContentCache & getContentCache() const
- public clang::SrcMgr::CharacteristicKind getFileCharacteristic() const
- public clang::SourceLocation getIncludeLoc() const
- public llvm::StringRef getName() const
- public bool hasLineDirectives() const
- public void setHasLineDirectives()
Methods
¶static clang::SrcMgr::FileInfo get(
clang::SourceLocation IL,
clang::SrcMgr::ContentCache& Con,
clang::SrcMgr::CharacteristicKind
FileCharacter,
llvm::StringRef Filename)
static clang::SrcMgr::FileInfo get(
clang::SourceLocation IL,
clang::SrcMgr::ContentCache& Con,
clang::SrcMgr::CharacteristicKind
FileCharacter,
llvm::StringRef Filename)
Description
Return a FileInfo object.
Declared at: clang/include/clang/Basic/SourceManager.h:308
Parameters
- clang::SourceLocation IL
- clang::SrcMgr::ContentCache& Con
- clang::SrcMgr::CharacteristicKind FileCharacter
- llvm::StringRef Filename
¶const clang::SrcMgr::ContentCache&
getContentCache() const
const clang::SrcMgr::ContentCache&
getContentCache() const
Declared at: clang/include/clang/Basic/SourceManager.h:324
¶clang::SrcMgr::CharacteristicKind
getFileCharacteristic() const
clang::SrcMgr::CharacteristicKind
getFileCharacteristic() const
Description
Return whether this is a system header or not.
Declared at: clang/include/clang/Basic/SourceManager.h:329
¶clang::SourceLocation getIncludeLoc() const
clang::SourceLocation getIncludeLoc() const
Declared at: clang/include/clang/Basic/SourceManager.h:320
¶llvm::StringRef getName() const
llvm::StringRef getName() const
Description
Returns the name of the file that was used when the file was loaded from the underlying file system.
Declared at: clang/include/clang/Basic/SourceManager.h:342
¶bool hasLineDirectives() const
bool hasLineDirectives() const
Description
Return true if this FileID has # line directives in it.
Declared at: clang/include/clang/Basic/SourceManager.h:334
¶void setHasLineDirectives()
void setHasLineDirectives()
Description
Set the flag that indicates that this FileID has line table entries associated with it.
Declared at: clang/include/clang/Basic/SourceManager.h:338