Lines Matching +full:adopt +full:- +full:info
1 //===--- NestedNameSpecifier.cpp - C++ nested name specifiers -----*- C++ -*-=//
8 //===----------------------------------------------------------------------===//
11 // a C++ nested-name-specifier.
13 //===----------------------------------------------------------------------===//
49 assert((!Prefix || Prefix->isDependent()) && "Prefix must be dependent"); in Create()
64 (Prefix->getAsType() == nullptr && in Create()
65 Prefix->getAsIdentifier() == nullptr)) && in Create()
80 (Prefix->getAsType() == nullptr && in Create()
81 Prefix->getAsIdentifier() == nullptr)) && in Create()
183 return getAsType()->getAsCXXRecordDecl(); in getAsRecordDecl()
204 for (const auto &Base : RD->bases()) in isDependent()
205 if (Base.getType()->isDependentType()) in isDependent()
213 return getAsType()->isDependentType(); in isDependent()
235 return getAsType()->isInstantiationDependentType(); in isInstantiationDependent()
244 return getPrefix() && getPrefix()->containsUnexpandedParameterPack(); in containsUnexpandedParameterPack()
254 return getAsType()->containsUnexpandedParameterPack(); in containsUnexpandedParameterPack()
266 getPrefix()->print(OS, Policy); in print()
270 OS << getAsIdentifier()->getName(); in print()
274 if (getAsNamespace()->isAnonymousNamespace()) in print()
277 OS << getAsNamespace()->getName(); in print()
281 OS << getAsNamespaceAlias()->getName(); in print()
301 // Nested-name-specifiers are intended to contain minimally-qualified in print()
303 // just the type that is referred to in the nested-name-specifier (e.g., in print()
305 // dependent template-id types (e.g., Outer<T>::template Inner<U>), in print()
306 // the type requires its own nested-name-specifier for uniqueness, so we in print()
307 // suppress that nested-name-specifier during printing. in print()
309 "Elaborated type in nested-name-specifier"); in print()
313 // nested-name-specifier. in print()
314 SpecType->getTemplateName().print(OS, InnerPolicy, true); in print()
318 OS, SpecType->template_arguments(), InnerPolicy); in print()
341 assert(Qualifier && "Expected a non-NULL qualifier"); in getLocalDataLength()
346 switch (Qualifier->getKind()) { in getLocalDataLength()
373 for (; Qualifier; Qualifier = Qualifier->getPrefix()) in getDataLength()
412 unsigned Offset = getDataLength(Qualifier->getPrefix()); in getLocalSourceRange()
413 switch (Qualifier->getKind()) { in getLocalSourceRange()
429 TypeLoc TL(Qualifier->getAsType(), TypeData); in getLocalSourceRange()
439 assert((Qualifier->getKind() == NestedNameSpecifier::TypeSpec || in getTypeLoc()
440 Qualifier->getKind() == NestedNameSpecifier::TypeSpecWithTemplate) && in getTypeLoc()
441 "Nested-name-specifier location is not a type"); in getTypeLoc()
444 unsigned Offset = getDataLength(Qualifier->getPrefix()); in getTypeLoc()
446 return TypeLoc(Qualifier->getAsType(), TypeData); in getTypeLoc()
455 if (BufferSize + (End - Start) > BufferCapacity) { in Append()
459 (unsigned)(BufferSize + (End - Start))); in Append()
469 memcpy(Buffer + BufferSize, Start, End - Start); in Append()
470 BufferSize += End-Start; in Append()
517 // Re-use our storage. in operator =()
557 // Push source-location info into the buffer. in Extend()
569 // Push source-location info into the buffer. in Extend()
581 // Push source-location info into the buffer. in Extend()
592 // Push source-location info into the buffer. in Extend()
599 assert(!Representation && "Already have a nested-name-specifier!?"); in MakeGlobal()
602 // Push source-location info into the buffer. in MakeGlobal()
612 // Push source-location info into the buffer. in MakeSuper()
622 // Construct bogus (but well-formed) source information for the in MakeTrivial()
623 // nested-name-specifier. in MakeTrivial()
626 for (NestedNameSpecifier *NNS = Qualifier; NNS; NNS = NNS->getPrefix()) in MakeTrivial()
630 switch (NNS->getKind()) { in MakeTrivial()
640 = Context.getTrivialTypeSourceInfo(QualType(NNS->getAsType(), 0), in MakeTrivial()
642 SavePointer(TSInfo->getTypeLoc().getOpaqueData(), Buffer, BufferSize, in MakeTrivial()
658 void NestedNameSpecifierLocBuilder::Adopt(NestedNameSpecifierLoc Other) { in Adopt() function in NestedNameSpecifierLocBuilder
668 // Rather than copying the data (which is wasteful), "adopt" the in Adopt()
687 // FIXME: After copying the source-location information, should we free in getWithLocInContext()
688 // our (temporary) buffer and adopt the ASTContext-allocated memory? in getWithLocInContext()