clang: lib/Index/IndexDecl.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

17

18using namespace clang;

19using namespace index;

20

21#define TRY_DECL(D,CALL_EXPR) \

22 do { \

23 if (!IndexCtx.shouldIndex(D)) return true; \

24 if (!CALL_EXPR) \

25 return false; \

26 } while (0)

27

28#define TRY_TO(CALL_EXPR) \

29 do { \

30 if (!CALL_EXPR) \

31 return false; \

32 } while (0)

33

34namespace {

35

36class IndexingDeclVisitor : public ConstDeclVisitor<IndexingDeclVisitor, bool> {

38

39public:

41 : IndexCtx(indexCtx) { }

42

43 bool Handled = true;

44

45 bool VisitDecl(const Decl *D) {

46 Handled = false;

47 return true;

48 }

49

57 break;

60 break;

64 Parent, DC);

68 if (const NamedDecl *TTD = TD->getTemplatedDecl())

70 }

71 break;

72 default:

73 break;

74 }

75 }

76

77

78

82 D->isInstanceMethod());

85 }

86

87

89 const NamedDecl *Parent = nullptr,

90 bool isIBType = false) {

91 if (!Parent) Parent = D;

92

95 false, isIBType);

97 auto IndexDefaultParmeterArgument = [&](const ParmVarDecl *Parm,

102 };

104 if (const ParmVarDecl *Parm = dyn_cast(D)) {

106 if (auto *FD = dyn_cast(DC)) {

108 FD->isThisDeclarationADefinition())

110 } else if (auto *MD = dyn_cast(DC)) {

111 if (MD->isThisDeclarationADefinition())

113 } else {

115 }

116 } else if (const FunctionDecl *FD = dyn_cast(D)) {

118 FD->isThisDeclarationADefinition()) {

119 for (const auto *PI : FD->parameters()) {

120 IndexDefaultParmeterArgument(PI, D);

122 }

123 }

124 }

125 } else {

126

127 if (const auto *FD = dyn_cast(D)) {

128 if (FD->isThisDeclarationADefinition()) {

129 for (const auto *PV : FD->parameters()) {

130 IndexDefaultParmeterArgument(PV, D);

131 }

132 }

133 }

134 }

136 IndexCtx.indexBody(C.ConstraintExpr, Parent);

137 }

138

143

144 D->getOverriddenMethods(Overriden);

145 for(auto overridden: Overriden) {

146 Relations.emplace_back((unsigned) SymbolRole::RelationOverrideOf,

147 overridden);

148 }

149 if (AssociatedProp)

150 Relations.emplace_back((unsigned)SymbolRole::RelationAccessorOf,

151 AssociatedProp);

152

153

154

158

160

161

162 if (AssociatedProp) {

163 bool isGetter = !D->param_size();

164 AttrLoc = isGetter ?

165 AssociatedProp->getGetterNameLoc():

166 AssociatedProp->getSetterNameLoc();

167 }

168

172 MethodLoc = AttrLoc;

173 } else {

175 }

176 } else if (AttrLoc.isValid()) {

179 }

180

183 bool hasIBActionAndFirst = D->hasAttr();

184 for (const auto *I : D->parameters()) {

185 handleDeclarator(I, D, hasIBActionAndFirst);

186 hasIBActionAndFirst = false;

187 }

188

189 if (D->isThisDeclarationADefinition()) {

191 if (Body) {

193 }

194 }

195 return true;

196 }

197

198

199

200

201

202

203

204 void

205 gatherTemplatePseudoOverrides(const NamedDecl *D,

208 return;

209 const auto *CTSD =

211 if (!CTSD)

212 return;

215 Template = CTSD->getSpecializedTemplateOrPartial();

217 const CXXRecordDecl *Pattern = CTD->getTemplatedDecl();

219 for (const NamedDecl *ND : Pattern->lookup(D->getDeclName())) {

220 if (const auto *CTD = dyn_cast(ND))

221 ND = CTD->getTemplatedDecl();

222 if (ND->isImplicit())

223 continue;

224

225 if (!TypeOverride) {

226 if (ND->getKind() != D->getKind())

227 continue;

229 continue;

230 if (const auto *FD = dyn_cast(ND)) {

232

233 if (FD->getStorageClass() != DFD->getStorageClass() ||

234 FD->getNumParams() != DFD->getNumParams())

235 continue;

236 }

237 Relations.emplace_back(

238 SymbolRoleSet(SymbolRole::RelationSpecializationOf), ND);

239 }

240 }

241 }

242

243 bool VisitFunctionDecl(const FunctionDecl *D) {

246 if (auto *CXXMD = dyn_cast(D)) {

247 if (CXXMD->isVirtual())

248 Roles |= (unsigned)SymbolRole::Dynamic;

250 Relations.emplace_back((unsigned)SymbolRole::RelationOverrideOf, O);

251 }

252 }

253 gatherTemplatePseudoOverrides(D, Relations);

255 Relations.push_back(

257 Base->getTemplatedDecl()));

258

260 handleDeclarator(D);

261

262 if (const CXXConstructorDecl *Ctor = dyn_cast(D)) {

263 IndexCtx.handleReference(Ctor->getParent(), Ctor->getLocation(),

264 Ctor->getParent(), Ctor->getDeclContext(),

265 (unsigned)SymbolRole::NameReference);

266

267

268 for (const auto *Init : Ctor->inits()) {

269 if (Init->isWritten()) {

273 (unsigned)SymbolRole::Write);

275 }

276 }

277 } else if (const CXXDestructorDecl *Dtor = dyn_cast(D)) {

278 if (auto TypeNameInfo = Dtor->getNameInfo().getNamedTypeInfo()) {

280 TypeNameInfo->getTypeLoc().getBeginLoc(),

281 Dtor->getParent(), Dtor->getDeclContext(),

282 (unsigned)SymbolRole::NameReference);

283 }

284 } else if (const auto *Guide = dyn_cast(D)) {

285 IndexCtx.handleReference(Guide->getDeducedTemplate()->getTemplatedDecl(),

286 Guide->getLocation(), Guide,

287 Guide->getDeclContext());

288 }

289

292 for (const auto &Arg : TemplateArgInfo->arguments())

294 }

295

298 if (Body) {

300 }

301 }

302 return true;

303 }

304

305 bool VisitVarDecl(const VarDecl *D) {

307 gatherTemplatePseudoOverrides(D, Relations);

309 handleDeclarator(D);

311 return true;

312 }

313

315 for (const auto *Binding : D->bindings())

317 return Base::VisitDecompositionDecl(D);

318 }

319

320 bool VisitFieldDecl(const FieldDecl *D) {

322 gatherTemplatePseudoOverrides(D, Relations);

324 handleDeclarator(D);

329 return true;

330 }

331

332 bool VisitObjCIvarDecl(const ObjCIvarDecl *D) {

334

335 return true;

336 }

338 handleDeclarator(D);

339 return true;

340 }

341

344 handleDeclarator(D);

345 return true;

346 }

347

351 return true;

352 }

353

357 gatherTemplatePseudoOverrides(D, Relations);

360 }

361 return true;

362 }

363

364 bool VisitTagDecl(const TagDecl *D) {

365

369 gatherTemplatePseudoOverrides(D, Relations);

371 } else {

373 gatherTemplatePseudoOverrides(D, Relations);

376 }

377 }

378 return true;

379 }

380

381 bool VisitEnumDecl(const EnumDecl *ED) {

382 TRY_TO(VisitTagDecl(ED));

383

384

387 return true;

388 }

389

390 bool handleReferencedProtocols(const ObjCProtocolList &ProtList,

395 I = ProtList.begin(), E = ProtList.end(); I != E; ++I, ++LI) {

399 if (Loc == SuperLoc)

402 SymbolRelation{(unsigned)SymbolRole::RelationBaseOf, ContD}));

403 }

404 return true;

405 }

406

412 bool hasSuperTypedef = false;

414 if (auto *TT = TInfo->getType()->getAs<TypedefType>()) {

415 if (auto *TD = TT->getDecl()) {

416 hasSuperTypedef = true;

419 }

420 }

421 }

423 if (hasSuperTypedef)

424 superRoles |= (SymbolRoleSet)SymbolRole::Implicit;

426 SymbolRelation{(unsigned)SymbolRole::RelationBaseOf, D}));

427 }

429 SuperLoc));

431 } else {

434 }

435 return true;

436 }

437

444 } else {

447 }

448 return true;

449 }

450

453 if (!Class)

454 return true;

455

456 if (Class->isImplicitInterfaceDecl())

458

460

461

462

463

465 if (I->getLocation().isInvalid())

467 }

468 for (const auto *I : D->decls()) {

472 }

473

474 return true;

475 }

476

479 return true;

481 if (C)

482 return true;

485 (unsigned)SymbolRole::RelationExtendedBy, D

486 }));

488 if (!CategoryLoc.isValid())

494 return true;

495 }

496

499 if (!Cat)

500 return true;

502 if (C)

506 if (!CategoryLoc.isValid())

510 return true;

511 }

512

514

515

517 return true;

518

519 handleObjCMethod(D);

520 return true;

521 }

522

526 handleObjCMethod(MD, D);

529 handleObjCMethod(MD, D);

531 if (IBOutletCollectionAttr *attr = D->getAttr())

535 return true;

536 }

537

544

546 Relations.push_back({(SymbolRoleSet)SymbolRole::RelationAccessorOf, ID});

550 }

552

554 return true;

555

560 if (MD->isPropertyAccessor() && !hasUserDefined(MD, Container))

561 IndexCtx.handleDecl(MD, Loc, AccessorMethodRoles, {}, Container);

562 }

564 if (MD->isPropertyAccessor() && !hasUserDefined(MD, Container))

565 IndexCtx.handleDecl(MD, Loc, AccessorMethodRoles, {}, Container);

566 }

568 if (IvarD->getSynthesize()) {

569

570

571

572

573

574

580 } else if (D->getLocation() == IvarLoc) {

582 }

584 } else {

587 }

588 }

589 return true;

590 }

591

592 bool VisitNamespaceDecl(const NamespaceDecl *D) {

595 return true;

596 }

597

603 return true;

604 }

605

606 bool VisitUsingDecl(const UsingDecl *D) {

608

610 const NamedDecl *Parent = dyn_cast(DC);

613 for (const auto *I : D->shadows()) {

614

615

616

618 continue;

619

622 }

623 return true;

624 }

625

628 const NamedDecl *Parent = dyn_cast(DC);

629

630

631

635

640 }

641

645 const NamedDecl *Parent = dyn_cast(DC);

648 return true;

649 }

650

654 const NamedDecl *Parent = dyn_cast(DC);

657 return true;

658 }

659

660 bool VisitClassTemplateSpecializationDecl(const

662

663

667 const Decl *SpecializationOf =

675 SpecializationOf));

676

679 for (const auto &Arg : TemplateArgInfo->arguments())

681 }

682 return true;

683 }

684

685 static bool shouldIndexTemplateParameterDefaultValue(const NamedDecl *D) {

686

687

688 if (!D)

689 return false;

690 if (const auto *FD = dyn_cast(D))

691 return FD->getCanonicalDecl() == FD;

692 else if (const auto *TD = dyn_cast(D))

693 return TD->getCanonicalDecl() == TD;

694 else if (const auto *VD = dyn_cast(D))

695 return VD->getCanonicalDecl() == VD;

696 return true;

697 }

698

701 for (const NamedDecl *TP : *Params) {

704 if (const auto *TTP = dyn_cast(TP)) {

705 if (TTP->hasDefaultArgument())

706 handleTemplateArgumentLoc(TTP->getDefaultArgument(), Parent,

708 if (auto *C = TTP->getTypeConstraint())

709 IndexCtx.handleReference(C->getNamedConcept(), C->getConceptNameLoc(),

711 } else if (const auto *NTTP = dyn_cast(TP)) {

713 if (NTTP->hasDefaultArgument())

714 handleTemplateArgumentLoc(NTTP->getDefaultArgument(), Parent,

716 } else if (const auto *TTPD = dyn_cast(TP)) {

717 if (TTPD->hasDefaultArgument())

718 handleTemplateArgumentLoc(TTPD->getDefaultArgument(), Parent,

720 }

721 }

722 if (auto *R = Params->getRequiresClause())

724 }

725

726 bool VisitTemplateDecl(const TemplateDecl *D) {

728 if (!Parent)

729 return true;

730

731

733 if (Params && shouldIndexTemplateParameterDefaultValue(Parent)) {

734 indexTemplateParameters(Params, Parent);

735 }

736

737 return Visit(Parent);

738 }

739

740 bool VisitConceptDecl(const ConceptDecl *D) {

742 indexTemplateParameters(Params, D);

746 }

747

748 bool VisitFriendDecl(const FriendDecl *D) {

750

751

752

753

754

755

757 return true;

758 return Visit(ND);

759 }

762 }

763 return true;

764 }

765

766 bool VisitImportDecl(const ImportDecl *D) {

768 }

769

774 return true;

775 }

776};

777

778}

779

781 if (D->isImplicit() && shouldIgnoreIfImplicit(D))

782 return true;

783

785 return true;

786

787 IndexingDeclVisitor Visitor(*this);

788 bool ShouldContinue = Visitor.Visit(D);

789 if (!ShouldContinue)

790 return false;

791

794

795 return true;

796}

797

799 for (const auto *I : DC->decls())

801 return false;

802 return true;

803}

804

807 return true;

808

810 return true;

811

812 if (IndexOpts.ShouldTraverseDecl && !IndexOpts.ShouldTraverseDecl(D))

813 return true;

814

816}

817

821 return false;

822 return true;

823}

This file provides AST data structures related to concepts.

Defines the C++ template declaration subclasses.

#define TRY_TO(CALL_EXPR)

Definition IndexDecl.cpp:28

#define TRY_DECL(D, CALL_EXPR)

Definition IndexDecl.cpp:21

shadow_range shadows() const

Represents a C++ constructor within a class.

Represents a C++ destructor within a class.

Represents a static or instance method of a struct/union/class.

overridden_method_range overridden_methods() const

Represents a C++ struct/union/class.

Declaration of a class template.

Represents a class template specialization, which refers to a class template with a given set of temp...

const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const

Retrieve the template argument list as written in the sources, if any.

llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const

Retrieve the class template or class template partial specialization which was specialized by this.

Declaration of a C++20 concept.

Expr * getConstraintExpr() const

A simple visitor class that helps create declaration visitors.

DeclContext - This is used only as base class of specific decl types that can act as declaration cont...

bool isDependentContext() const

Determines whether this context is dependent on a template parameter.

lookup_result lookup(DeclarationName Name) const

lookup - Find the declarations (if any) with the given Name in this context.

DeclContext * getRedeclContext()

getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...

decl_range decls() const

decls_begin/decls_end - Iterate over the declarations stored in this context.

Decl - This represents one declaration (or definition), e.g.

const DeclContext * getParentFunctionOrMethod(bool LexicalParent=false) const

If this decl is defined inside a function/method/block it returns the corresponding DeclContext,...

bool isImplicit() const

isImplicit - Indicates whether the declaration was implicitly generated by the implementation.

virtual Stmt * getBody() const

getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...

SourceLocation getLocation() const

DeclContext * getDeclContext()

DeclContext * getLexicalDeclContext()

getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).

Represents a ValueDecl that came out of a declarator.

A decomposition declaration.

ArrayRef< BindingDecl * > bindings() const

An instance of this object exists for each enum constant that is defined.

const Expr * getInitExpr() const

TypeSourceInfo * getIntegerTypeSourceInfo() const

Return the type source info for the underlying integer type, if no type source info exists,...

Represents a member of a struct/union/class.

Expr * getInClassInitializer() const

Get the C++11 default member initializer for this member, or null if one has not been set.

bool isBitField() const

Determines whether this field is a bitfield.

bool hasInClassInitializer() const

Determine whether this member has a C++11 default member initializer.

Expr * getBitWidth() const

Returns the expression that represents the bit width, if this field is a bit field.

FriendDecl - Represents the declaration of a friend entity, which can be a function,...

NamedDecl * getFriendDecl() const

If this friend declaration doesn't name a type, return the inner declaration.

TypeSourceInfo * getFriendType() const

If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...

Represents a function declaration or definition.

Stmt * getBody(const FunctionDecl *&Definition) const

Retrieve the body (definition) of the function.

bool isThisDeclarationADefinition() const

Returns whether this specific declaration of the function is also a definition that does not contain ...

FunctionTemplateDecl * getPrimaryTemplate() const

Retrieve the primary template that this function template specialization either specializes or was in...

const ASTTemplateArgumentListInfo * getTemplateSpecializationArgsAsWritten() const

Retrieve the template argument list as written in the sources, if any.

Describes a module import declaration, which makes the contents of the named module visible in the cu...

An instance of this class represents the declaration of a property member.

This represents a decl that may have a name.

Represents a C++ namespace alias.

NestedNameSpecifierLoc getQualifierLoc() const

Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...

NamespaceBaseDecl * getAliasedNamespace() const

Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...

SourceLocation getTargetNameLoc() const

Returns the location of the identifier in the named namespace.

Represent a C++ namespace.

ObjCCategoryDecl - Represents a category declaration.

ObjCInterfaceDecl * getClassInterface()

const ObjCProtocolList & getReferencedProtocols() const

SourceLocation getCategoryNameLoc() const

ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.

SourceLocation getCategoryNameLoc() const

ObjCCategoryDecl * getCategoryDecl() const

ObjCContainerDecl - Represents a container for method declarations.

ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const

propimpl_range property_impls() const

const ObjCInterfaceDecl * getClassInterface() const

ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...

Represents an ObjC class declaration.

SourceLocation getSuperClassLoc() const

Retrieve the starting location of the superclass.

bool isThisDeclarationADefinition() const

Determine whether this particular declaration of this class is actually also a definition.

const ObjCProtocolList & getReferencedProtocols() const

ObjCProtocolList::iterator protocol_iterator

ObjCProtocolList::loc_iterator protocol_loc_iterator

ObjCInterfaceDecl * getSuperClass() const

TypeSourceInfo * getSuperClassTInfo() const

ObjCIvarDecl - Represents an ObjC instance variable.

bool getSynthesize() const

ObjCMethodDecl - Represents an instance or class method declaration.

bool isPropertyAccessor() const

bool isSynthesizedAccessorStub() const

bool isThisDeclarationADefinition() const

Returns whether this specific method is a definition.

Represents one property declaration in an Objective-C interface.

ObjCMethodDecl * getGetterMethodDecl() const

ObjCMethodDecl * getSetterMethodDecl() const

TypeSourceInfo * getTypeSourceInfo() const

ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...

ObjCIvarDecl * getPropertyIvarDecl() const

SourceLocation getPropertyIvarDeclLoc() const

Kind getPropertyImplementation() const

ObjCPropertyDecl * getPropertyDecl() const

Represents an Objective-C protocol declaration.

bool isThisDeclarationADefinition() const

Determine whether this particular declaration is also the definition.

const ObjCProtocolList & getReferencedProtocols() const

A list of Objective-C protocols, along with the source locations at which they were referenced.

loc_iterator loc_begin() const

Represents a parameter to a function.

bool hasUnparsedDefaultArg() const

Determines whether this parameter has a default argument that has not yet been parsed.

bool hasUninstantiatedDefaultArg() const

bool hasDefaultArg() const

Determines whether this parameter has a default argument, either parsed or not.

Encodes a location in the source.

bool isValid() const

Return true if this is a valid SourceLocation object.

Represents a C++11 static_assert declaration.

Stmt - This represents one statement.

Represents the declaration of a struct/union/class/enum.

bool isThisDeclarationADefinition() const

Return true if this declaration is a completion definition of the type.

NestedNameSpecifierLoc getQualifierLoc() const

Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...

bool isFreeStanding() const

True if this tag is free standing, e.g. "struct foo;".

Location wrapper for a TemplateArgument.

TemplateArgumentLocInfo getLocInfo() const

const TemplateArgument & getArgument() const

SourceLocation getTemplateNameLoc() const

NestedNameSpecifierLoc getTemplateQualifierLoc() const

@ Template

The template argument is a template name that was provided for a template template parameter.

@ TemplateExpansion

The template argument is a pack expansion of a template name that was provided for a template templat...

@ Type

The template argument is a type.

@ Expression

The template argument is an expression, and we've not resolved it to one of the other forms yet,...

ArgKind getKind() const

Return the kind of stored template argument.

TemplateName getAsTemplateOrTemplatePattern() const

Retrieve the template argument as a template name; if the argument is a pack expansion,...

The base class of all kinds of template declarations (e.g., class, function, etc.).

NamedDecl * getTemplatedDecl() const

Get the underlying, templated declaration.

TemplateParameterList * getTemplateParameters() const

Get the list of template parameters.

TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const

Retrieve the underlying template declaration that this template name refers to, if known.

Stores a list of template parameters for a TemplateDecl and its derived classes.

Base class for declarations which introduce a typedef-name.

TypeSourceInfo * getTypeSourceInfo() const

bool isTransparentTag() const

Determines if this typedef shares a name and spelling location with its underlying tag type,...

Represents a dependent using declaration which was marked with typename.

NestedNameSpecifierLoc getQualifierLoc() const

Retrieve the nested-name-specifier that qualifies the name, with source-location information.

Represents a dependent using declaration which was not marked with typename.

NestedNameSpecifierLoc getQualifierLoc() const

Retrieve the nested-name-specifier that qualifies the name, with source-location information.

Represents a C++ using-declaration.

NestedNameSpecifierLoc getQualifierLoc() const

Retrieve the nested-name-specifier that qualifies the name, with source-location information.

Represents C++ using-directive.

NamedDecl * getNominatedNamespaceAsWritten()

NestedNameSpecifierLoc getQualifierLoc() const

Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...

Represents a variable declaration or definition.

const Expr * getInit() const

bool shouldIndexImplicitInstantiation() const

bool importedModule(const ImportDecl *ImportD)

bool handleDecl(const Decl *D, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations={})

bool shouldIndex(const Decl *D)

bool indexDeclContext(const DeclContext *DC)

Definition IndexDecl.cpp:798

bool handleReference(const NamedDecl *D, SourceLocation Loc, const NamedDecl *Parent, const DeclContext *DC, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations={}, const Expr *RefE=nullptr)

void indexTagDecl(const TagDecl *D, ArrayRef< SymbolRelation > Relations={})

bool shouldIndexFunctionLocalSymbols() const

void indexNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS, const NamedDecl *Parent, const DeclContext *DC=nullptr)

bool indexTopLevelDecl(const Decl *D)

Definition IndexDecl.cpp:805

bool shouldIndexTemplateParameters() const

void indexBody(const Stmt *S, const NamedDecl *Parent, const DeclContext *DC=nullptr)

bool shouldIndexParametersInDeclarations() const

bool indexDeclGroupRef(DeclGroupRef DG)

Definition IndexDecl.cpp:818

static bool isTemplateImplicitInstantiation(const Decl *D)

const LangOptions & getLangOpts() const

bool indexDecl(const Decl *D)

Definition IndexDecl.cpp:780

void indexTypeSourceInfo(TypeSourceInfo *TInfo, const NamedDecl *Parent, const DeclContext *DC=nullptr, bool isBase=false, bool isIBType=false)

The JSON file list parser is used to communicate input to InstallAPI.

bool isa(CodeGen::Address addr)

@ Template

We are parsing a template declaration.

U cast(CodeGen::Address addr)

Represents an explicit template argument list in C++, e.g., the "" in "sort".

Location information for a TemplateArgument.

TypeSourceInfo * getAsTypeSourceInfo() const

Represents a relation to another symbol for a symbol occurrence.