clang API Documentation

Classes | Namespaces | Typedefs | Enumerations | Functions
SourceManager.h File Reference

Defines the SourceManager interface. More...

#include "clang/Basic/FileManager.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/MemoryBuffer.h"
#include <cassert>
#include <map>
#include <memory>
#include <vector>
Include dependency graph for SourceManager.h:

Go to the source code of this file.

Classes

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::OverriddenFilesInfoTy
struct  clang::SourceManager::MemoryBufferSizes
class  clang::BeforeThanCompare< SourceLocation >
 Compare two source locations. More...
class  clang::BeforeThanCompare< SourceRange >
 Compare two non-overlapping source ranges. More...

Namespaces

namespace  clang
namespace  clang::SrcMgr
 

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


Typedefs

typedef ArrayRef< std::pair
< std::string, FullSourceLoc > > 
clang::ModuleBuildStack
 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 }
 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

 clang::SrcMgr::static_assert (llvm::AlignOf< ContentCache >::Alignment >=8,"ContentCache must be 8-byte aligned.")

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);

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.