;
25TypeLocs.push_back(CurTL);
29 for(
unsignedi = 0, e = TypeLocs.size(); i < e; ++i) {
30 TypeLocCurTL = TypeLocs[e-i-1];
32#define ABSTRACT_TYPELOC(CLASS, PARENT) 33#define TYPELOC(CLASS, PARENT) \ 34 case TypeLoc::CLASS: { \ 35 CLASS##TypeLoc NewTL = push<class CLASS##TypeLoc>(CurTL.getType()); \ 36 memcpy(NewTL.getOpaqueData(), CurTL.getOpaqueData(), NewTL.getLocalDataSize()); \ 39#include "clang/AST/TypeLocNodes.def" 50 for(
autoCurTL = L; CurTL; CurTL = CurTL.getNextTypeLoc())
51TypeLocs.push_back(CurTL);
53 for(
const auto&CurTL : llvm::reverse(TypeLocs)) {
54 switch(CurTL.getTypeLocClass()) {
55#define ABSTRACT_TYPELOC(CLASS, PARENT) 56#define TYPELOC(CLASS, PARENT) \ 57 case TypeLoc::CLASS: { \ 58 auto NewTL = push<class CLASS##TypeLoc>(CurTL.getType()); \ 59 NewTL.initializeLocal(Context, Loc); \ 62#include "clang/AST/TypeLocNodes.def" 67voidTypeLocBuilder::grow(
size_tNewCapacity) {
68assert(NewCapacity > Capacity);
71 char*NewBuffer =
new char[NewCapacity];
72 unsignedNewIndex = Index + NewCapacity - Capacity;
73 memcpy(&NewBuffer[NewIndex],
77 if(Buffer != InlineBuffer)
81Capacity = NewCapacity;
85TypeLocTypeLocBuilder::pushImpl(
QualType T,
size_tLocalSize,
unsignedLocalAlignment) {
88assert(TLast == LastTy &&
89 "mismatch between last type and new type's inner type");
93assert(LocalAlignment <= BufferMaxAlignment &&
"Unexpected alignment");
96 if(LocalSize > Index) {
97 size_tRequiredCapacity = Capacity + (LocalSize - Index);
98 size_tNewCapacity = Capacity * 2;
99 while(RequiredCapacity > NewCapacity)
110 if(LocalAlignment == 4) {
112NumBytesAtAlign4 += LocalSize;
114 unsignedPadding = NumBytesAtAlign4 % 8;
116 if(LocalSize % 8 == 0) {
120assert(LocalSize % 8 == 4);
122memmove(&Buffer[Index - 4], &Buffer[Index], NumBytesAtAlign4);
126assert(Padding == 4);
127 if(LocalSize % 8 == 0) {
131assert(LocalSize % 8 == 4);
133memmove(&Buffer[Index + 4], &Buffer[Index], NumBytesAtAlign4);
137NumBytesAtAlign4 += LocalSize;
139}
else if(LocalAlignment == 8) {
143 if((Index - LocalSize) % 8 != 0) {
144memmove(&Buffer[Index - 4], &Buffer[Index], NumBytesAtAlign4);
148 unsignedPadding = NumBytesAtAlign4 % 8;
150 if(LocalSize % 8 == 0) {
154assert(LocalSize % 8 == 4);
156memmove(&Buffer[Index - 4], &Buffer[Index], NumBytesAtAlign4);
160assert(Padding == 4);
161 if(LocalSize % 8 == 0) {
165assert(LocalSize % 8 == 4);
167memmove(&Buffer[Index + 4], &Buffer[Index], NumBytesAtAlign4);
174NumBytesAtAlign4 = 0;
177assert(LocalSize == 0);
183 "incorrect data size provided to CreateTypeSourceInfo!");
185 returngetTemporaryTypeLoc(
T);
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A (possibly-)qualified type.
Encodes a location in the source.
void pushFullCopy(TypeLoc L)
Pushes a copy of the given TypeLoc onto this builder.
void reserve(size_t Requested)
Ensures that this buffer has at least as much capacity as described.
void pushTrivial(ASTContext &Context, QualType T, SourceLocation Loc)
Pushes 'T' with all locations pointing to 'Loc'.
Base wrapper for a particular "section" of type source info.
QualType getType() const
Get the type for which this source info wrapper provides information.
TypeLoc getNextTypeLoc() const
Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...
unsigned getFullDataSize() const
Returns the size of the type source info data block.
TypeLocClass getTypeLocClass() const
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4