class ScratchBuffer

Declaration

class ScratchBuffer { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/Lex/ScratchBuffer.h:24

Member Variables

private clang::SourceManager& SourceMgr
private char* CurBuffer
private clang::SourceLocation BufferStartLoc
private unsigned int BytesUsed

Method Overview

  • private void AllocScratchBuffer(unsigned int RequestLen)
  • public ScratchBuffer(clang::SourceManager & SM)
  • public clang::SourceLocation getToken(const char * Buf, unsigned int Len, const char *& DestPtr)

Methods

void AllocScratchBuffer(unsigned int RequestLen)

Declared at: clang/include/clang/Lex/ScratchBuffer.h:39

Parameters

unsigned int RequestLen

ScratchBuffer(clang::SourceManager& SM)

Declared at: clang/include/clang/Lex/ScratchBuffer.h:30

Parameters

clang::SourceManager& SM

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

Description

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.

Declared at: clang/include/clang/Lex/ScratchBuffer.h:36

Parameters

const char* Buf
unsigned int Len
const char*& DestPtr