clang 20.0.0git
Classes | Namespaces | Typedefs | Enumerations | Functions
SourceManager.h File Reference

Defines the SourceManager interface. More...

#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileEntry.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/PagedVector.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/MemoryBuffer.h"
#include <cassert>
#include <cstddef>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  clang::SrcMgr::LineOffsetMapping
 Mapping of line offsets into a source file. More...
 
class  clang::SrcMgr::ContentCache
 One instance of this struct is kept for every file loaded or used. More...
 
class  clang::SrcMgr::FileInfo
 Information about a FileID, basically just the logical file that it represents and include stack information. More...
 
class  clang::SrcMgr::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  clang::SrcMgr::SLocEntry
 This is a discriminated union of FileInfo and ExpansionInfo. More...
 
class  clang::ExternalSLocEntrySource
 External source of source location entries. More...
 
class  clang::InBeforeInTUCacheEntry
 Holds the cache used by isBeforeInTranslationUnit. More...
 
class  clang::SourceManager
 This class handles loading and caching of source files into memory. More...
 
struct  clang::SourceManager::MemoryBufferSizes
 
class  clang::BeforeThanCompare< SourceLocation >
 Compare two source locations. More...
 
class  clang::BeforeThanCompare< SourceRange >
 Compare two non-overlapping source ranges. More...
 
class  clang::SourceManagerForFile
 SourceManager and necessary dependencies (e.g. More...
 

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::SrcMgr
 Public enums and private classes that are part of the SourceManager implementation.
 

Typedefs

using clang::ModuleBuildStack = ArrayRef< std::pair< std::string, FullSourceLoc > >
 The stack used when building modules on demand, which is used to provide a link between the source managers of the different compiler instances.
 

Enumerations

enum  clang::SrcMgr::CharacteristicKind {
  clang::SrcMgr::C_User , clang::SrcMgr::C_System , clang::SrcMgr::C_ExternCSystem , clang::SrcMgr::C_User_ModuleMap ,
  clang::SrcMgr::C_System_ModuleMap
}
 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

bool clang::SrcMgr::isSystem (CharacteristicKind CK)
 Determine whether a file / directory characteristic is for system code.
 
bool clang::SrcMgr::isModuleMap (CharacteristicKind CK)
 Determine whether a file characteristic is for a module map.
 

Detailed Description

Defines the SourceManager interface.

There are three different types of locations in a file: a spelling location, an expansion location, and a presumed location.

Given an example of:

#define min(x, y) x < y ? x : y

and then later on a use of min:

#line 17
return min(a, b);
__DEVICE__ int min(int __a, int __b)
__device__ __2f16 b

The expansion location is the line in the source code where the macro was expanded (the return statement), the spelling location is the location in the source where the macro was originally defined, and the presumed location is where the line directive states that the line is 17, or any other line.

Definition in file SourceManager.h.