clang 19.0.0git
Public Member Functions | List of all members
clang::ScratchBuffer Class Reference

ScratchBuffer - This class exposes a simple interface for the dynamic construction of tokens. More...

#include "clang/Lex/ScratchBuffer.h"

Public Member Functions

 ScratchBuffer (SourceManager &SM)
 
SourceLocation getToken (const char *Buf, unsigned Len, const char *&DestPtr)
 getToken - Splat the specified text into a temporary MemoryBuffer and return a SourceLocation that refers to the token.
 

Detailed Description

ScratchBuffer - This class exposes a simple interface for the dynamic construction of tokens.

This is used for builtin macros (e.g. LINE) as well as token pasting, etc.

Definition at line 24 of file ScratchBuffer.h.

Constructor & Destructor Documentation

◆ ScratchBuffer()

ScratchBuffer::ScratchBuffer ( SourceManager SM)

Definition at line 23 of file ScratchBuffer.cpp.

References ScratchBufSize.

Member Function Documentation

◆ getToken()

SourceLocation ScratchBuffer::getToken ( const char *  Buf,
unsigned  Len,
const char *&  DestPtr 
)

getToken - Splat the specified text into a temporary MemoryBuffer and return a SourceLocation that refers to the token.

This is just like the previous method, but returns a location that indicates the physloc of the token.

This is just like the method below, but returns a location that indicates the physloc of the token.

Definition at line 33 of file ScratchBuffer.cpp.

References clang::SrcMgr::FileInfo::getContentCache(), clang::SrcMgr::SLocEntry::getFile(), clang::SourceManager::getFileID(), clang::SourceLocation::getLocWithOffset(), clang::SourceManager::getSLocEntry(), memcpy(), ScratchBufSize, and clang::SrcMgr::ContentCache::SourceLineCache.


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