clang  3.9.0
Classes | Enumerations | Functions
clang::SrcMgr Namespace Reference

Public enums and private classes that are part of the SourceManager implementation. More...

Classes

class  FileInfo
 Information about a FileID, basically just the logical file that it represents and include stack information. More...
 
class  ExpansionInfo
 Each ExpansionInfo encodes the expansion location - where the token was ultimately expanded, and the SpellingLoc - where the actual character data for the token came from. More...
 
class  SLocEntry
 This is a discriminated union of FileInfo and ExpansionInfo. More...
 

Enumerations

enum  CharacteristicKind { C_User, C_System, C_ExternCSystem }
 Indicates whether a file or directory holds normal user code, system code, or system code which is implicitly 'extern "C"' in C++ mode. More...
 

Functions

class LLVM_ALIGNAS (8) ContentCache
 One instance of this struct is kept for every file loaded or used. More...
 

Detailed Description

Public enums and private classes that are part of the SourceManager implementation.

Enumeration Type Documentation

Indicates whether a file or directory holds normal user code, system code, or system code which is implicitly 'extern "C"' in C++ mode.

Entire directories can be tagged with this (this is maintained by DirectoryLookup and friends) as can specific FileInfos when a #pragma system_header is seen or in various other cases.

Enumerator
C_User 
C_System 
C_ExternCSystem 

Definition at line 78 of file SourceManager.h.

Function Documentation

class clang::SrcMgr::LLVM_ALIGNAS ( )

One instance of this struct is kept for every file loaded or used.

This object owns the MemoryBuffer object.

Whether the buffer is invalid.

Whether the buffer should not be freed on destruction.

The actual buffer containing the characters from the input file.

This is owned by the ContentCache object. The bits indicate whether the buffer is invalid.

Reference to the file entry representing this ContentCache.

This reference does not own the FileEntry object.

It is possible for this to be NULL if the ContentCache encapsulates an imaginary text buffer.

References the file which the contents were actually loaded from.

Can be different from 'Entry' if we overridden the contents of one file with the contents of another file.

A bump pointer allocated array of offsets for each source line.

This is lazily computed. This is owned by the SourceManager BumpPointerAllocator object.

The number of lines in this ContentCache.

This is only valid if SourceLineCache is non-null.

Indicates whether the buffer itself was provided to override the actual file contents.

When true, the original entry may be a virtual file that does not exist.

True if this content cache was initially created for a source file considered as a system one.

True if this file may be transient, that is, if it might not exist at some later point in time when this content entry is used, after serialization and deserialization.

The copy ctor does not allow copies where source object has either a non-NULL Buffer or SourceLineCache. Ownership of allocated memory is not transferred, so this is a logical error.

Returns the memory buffer for the associated content.

Parameters
DiagObject through which diagnostics will be emitted if the buffer cannot be retrieved.
LocIf specified, is the location that invalid file diagnostics will be emitted at.
InvalidIf non-NULL, will be set true if an error occurred.

Returns the size of the content encapsulated by this ContentCache.

This can be the size of the source file or the size of an arbitrary scratch buffer. If the ContentCache encapsulates a source file this size is retrieved from the file's FileEntry.

Returns the number of bytes actually mapped for this ContentCache.

This can be 0 if the MemBuffer was not actually expanded.

Returns the kind of memory used to back the memory buffer for this content cache. This is used for performance analysis.

Get the underlying buffer, returning NULL if the buffer is not yet available.

Replace the existing buffer (which will be deleted) with the given buffer.

Determine whether the buffer itself is invalid.

Determine whether the buffer should be freed.

Definition at line 85 of file SourceManager.h.

References Buffer, Diag(), and SM.