diff options
Diffstat (limited to 'lib/Index')
-rw-r--r-- | lib/Index/CMakeLists.txt | 1 | ||||
-rw-r--r-- | lib/Index/CodegenNameGenerator.cpp | 7 | ||||
-rw-r--r-- | lib/Index/CommentToXML.cpp | 14 | ||||
-rw-r--r-- | lib/Index/FileIndexRecord.cpp | 60 | ||||
-rw-r--r-- | lib/Index/FileIndexRecord.h | 57 | ||||
-rw-r--r-- | lib/Index/IndexBody.cpp | 7 | ||||
-rw-r--r-- | lib/Index/IndexDecl.cpp | 27 | ||||
-rw-r--r-- | lib/Index/IndexSymbol.cpp | 24 | ||||
-rw-r--r-- | lib/Index/IndexTypeSourceInfo.cpp | 22 | ||||
-rw-r--r-- | lib/Index/IndexingAction.cpp | 7 | ||||
-rw-r--r-- | lib/Index/IndexingContext.cpp | 28 | ||||
-rw-r--r-- | lib/Index/IndexingContext.h | 11 | ||||
-rw-r--r-- | lib/Index/SimpleFormatContext.h | 7 | ||||
-rw-r--r-- | lib/Index/USRGeneration.cpp | 16 |
14 files changed, 218 insertions, 70 deletions
diff --git a/lib/Index/CMakeLists.txt b/lib/Index/CMakeLists.txt index 1362143fb0..0551d43467 100644 --- a/lib/Index/CMakeLists.txt +++ b/lib/Index/CMakeLists.txt @@ -6,6 +6,7 @@ set(LLVM_LINK_COMPONENTS add_clang_library(clangIndex CodegenNameGenerator.cpp CommentToXML.cpp + FileIndexRecord.cpp IndexBody.cpp IndexDecl.cpp IndexingAction.cpp diff --git a/lib/Index/CodegenNameGenerator.cpp b/lib/Index/CodegenNameGenerator.cpp index bf52e2108b..b56d769331 100644 --- a/lib/Index/CodegenNameGenerator.cpp +++ b/lib/Index/CodegenNameGenerator.cpp @@ -1,9 +1,8 @@ //===- CodegenNameGenerator.cpp - Codegen name generation -----------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/lib/Index/CommentToXML.cpp b/lib/Index/CommentToXML.cpp index a2659119a2..55923d679f 100644 --- a/lib/Index/CommentToXML.cpp +++ b/lib/Index/CommentToXML.cpp @@ -1,9 +1,8 @@ //===--- CommentToXML.cpp - Convert comments to XML representation --------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -189,11 +188,8 @@ FullCommentParts::FullCommentParts(const FullComment *C, // Sort params in order they are declared in the function prototype. // Unresolved parameters are put at the end of the list in the same order // they were seen in the comment. - std::stable_sort(Params.begin(), Params.end(), - ParamCommandCommentCompareIndex()); - - std::stable_sort(TParams.begin(), TParams.end(), - TParamCommandCommentComparePosition()); + llvm::stable_sort(Params, ParamCommandCommentCompareIndex()); + llvm::stable_sort(TParams, TParamCommandCommentComparePosition()); } void printHTMLStartTagComment(const HTMLStartTagComment *C, diff --git a/lib/Index/FileIndexRecord.cpp b/lib/Index/FileIndexRecord.cpp new file mode 100644 index 0000000000..dd5ad71771 --- /dev/null +++ b/lib/Index/FileIndexRecord.cpp @@ -0,0 +1,60 @@ +//===--- FileIndexRecord.cpp - Index data per file --------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "FileIndexRecord.h" +#include "clang/AST/ASTContext.h" +#include "clang/AST/DeclTemplate.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Path.h" + +using namespace clang; +using namespace clang::index; + +void FileIndexRecord::addDeclOccurence(SymbolRoleSet Roles, unsigned Offset, + const Decl *D, + ArrayRef<SymbolRelation> Relations) { + assert(D->isCanonicalDecl() && + "Occurrences should be associated with their canonical decl"); + + auto IsNextOccurence = [&]() -> bool { + if (Decls.empty()) + return true; + auto &Last = Decls.back(); + return Last.Offset < Offset; + }; + + if (IsNextOccurence()) { + Decls.emplace_back(Roles, Offset, D, Relations); + return; + } + + DeclOccurrence NewInfo(Roles, Offset, D, Relations); + // We keep Decls in order as we need to access them in this order in all cases. + auto It = std::upper_bound(Decls.begin(), Decls.end(), NewInfo); + Decls.insert(It, std::move(NewInfo)); +} + +void FileIndexRecord::print(llvm::raw_ostream &OS) const { + OS << "DECLS BEGIN ---\n"; + for (auto &DclInfo : Decls) { + const Decl *D = DclInfo.Dcl; + SourceManager &SM = D->getASTContext().getSourceManager(); + SourceLocation Loc = SM.getFileLoc(D->getLocation()); + PresumedLoc PLoc = SM.getPresumedLoc(Loc); + OS << llvm::sys::path::filename(PLoc.getFilename()) << ':' << PLoc.getLine() + << ':' << PLoc.getColumn(); + + if (auto ND = dyn_cast<NamedDecl>(D)) { + OS << ' ' << ND->getNameAsString(); + } + + OS << '\n'; + } + OS << "DECLS END ---\n"; +} diff --git a/lib/Index/FileIndexRecord.h b/lib/Index/FileIndexRecord.h new file mode 100644 index 0000000000..37bf96a719 --- /dev/null +++ b/lib/Index/FileIndexRecord.h @@ -0,0 +1,57 @@ +//===--- FileIndexRecord.h - Index data per file ----------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_LIB_INDEX_FILEINDEXRECORD_H +#define LLVM_CLANG_LIB_INDEX_FILEINDEXRECORD_H + +#include "clang/Basic/SourceLocation.h" +#include "clang/Index/DeclOccurrence.h" +#include "clang/Index/IndexSymbol.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/SmallVector.h" +#include <vector> + +namespace clang { +class IdentifierInfo; + +namespace index { + +/// Stores the declaration occurrences seen in a particular source or header +/// file of a translation unit +class FileIndexRecord { +private: + FileID FID; + bool IsSystem; + std::vector<DeclOccurrence> Decls; + +public: + FileIndexRecord(FileID FID, bool IsSystem) : FID(FID), IsSystem(IsSystem) {} + + ArrayRef<DeclOccurrence> getDeclOccurrencesSortedByOffset() const { + return Decls; + } + + FileID getFileID() const { return FID; } + bool isSystem() const { return IsSystem; } + + /// Adds an occurrence of the canonical declaration \c D at the supplied + /// \c Offset + /// + /// \param Roles the roles the occurrence fulfills in this position. + /// \param Offset the offset in the file of this occurrence. + /// \param D the canonical declaration this is an occurrence of. + /// \param Relations the set of symbols related to this occurrence. + void addDeclOccurence(SymbolRoleSet Roles, unsigned Offset, const Decl *D, + ArrayRef<SymbolRelation> Relations); + void print(llvm::raw_ostream &OS) const; +}; + +} // end namespace index +} // end namespace clang + +#endif // LLVM_CLANG_LIB_INDEX_FILEINDEXRECORD_H diff --git a/lib/Index/IndexBody.cpp b/lib/Index/IndexBody.cpp index 54a6df2496..07a94f30c8 100644 --- a/lib/Index/IndexBody.cpp +++ b/lib/Index/IndexBody.cpp @@ -1,9 +1,8 @@ //===- IndexBody.cpp - Indexing statements --------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/lib/Index/IndexDecl.cpp b/lib/Index/IndexDecl.cpp index a7725f9dd9..7e6be5d7f6 100644 --- a/lib/Index/IndexDecl.cpp +++ b/lib/Index/IndexDecl.cpp @@ -1,9 +1,8 @@ //===- IndexDecl.cpp - Indexing declarations ------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -89,12 +88,11 @@ public: /*isBase=*/false, isIBType); IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent); if (IndexCtx.shouldIndexFunctionLocalSymbols()) { - // Only index parameters in definitions, parameters in declarations are - // not useful. if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) { auto *DC = Parm->getDeclContext(); if (auto *FD = dyn_cast<FunctionDecl>(DC)) { - if (FD->isThisDeclarationADefinition()) + if (IndexCtx.shouldIndexParametersInDeclarations() || + FD->isThisDeclarationADefinition()) IndexCtx.handleDecl(Parm); } else if (auto *MD = dyn_cast<ObjCMethodDecl>(DC)) { if (MD->isThisDeclarationADefinition()) @@ -103,7 +101,8 @@ public: IndexCtx.handleDecl(Parm); } } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { - if (FD->isThisDeclarationADefinition()) { + if (IndexCtx.shouldIndexParametersInDeclarations() || + FD->isThisDeclarationADefinition()) { for (auto PI : FD->parameters()) { IndexCtx.handleDecl(PI); } @@ -248,7 +247,8 @@ public: if (const CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) { IndexCtx.handleReference(Ctor->getParent(), Ctor->getLocation(), - Ctor->getParent(), Ctor->getDeclContext()); + Ctor->getParent(), Ctor->getDeclContext(), + (unsigned)SymbolRole::NameReference); // Constructor initializers. for (const auto *Init : Ctor->inits()) { @@ -264,7 +264,8 @@ public: if (auto TypeNameInfo = Dtor->getNameInfo().getNamedTypeInfo()) { IndexCtx.handleReference(Dtor->getParent(), TypeNameInfo->getTypeLoc().getBeginLoc(), - Dtor->getParent(), Dtor->getDeclContext()); + Dtor->getParent(), Dtor->getDeclContext(), + (unsigned)SymbolRole::NameReference); } } else if (const auto *Guide = dyn_cast<CXXDeductionGuideDecl>(D)) { IndexCtx.handleReference(Guide->getDeducedTemplate()->getTemplatedDecl(), @@ -325,6 +326,7 @@ public: } bool VisitMSPropertyDecl(const MSPropertyDecl *D) { + TRY_DECL(D, IndexCtx.handleDecl(D)); handleDeclarator(D); return true; } @@ -581,9 +583,10 @@ public: } bool VisitUsingDecl(const UsingDecl *D) { + IndexCtx.handleDecl(D); + const DeclContext *DC = D->getDeclContext()->getRedeclContext(); const NamedDecl *Parent = dyn_cast<NamedDecl>(DC); - IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent, D->getLexicalDeclContext()); for (const auto *I : D->shadows()) @@ -673,6 +676,8 @@ public: shouldIndexTemplateParameterDefaultValue(Parent)) { const TemplateParameterList *Params = D->getTemplateParameters(); for (const NamedDecl *TP : *Params) { + if (IndexCtx.shouldIndexTemplateParameters()) + IndexCtx.handleDecl(TP); if (const auto *TTP = dyn_cast<TemplateTypeParmDecl>(TP)) { if (TTP->hasDefaultArgument()) IndexCtx.indexTypeSourceInfo(TTP->getDefaultArgumentInfo(), Parent); diff --git a/lib/Index/IndexSymbol.cpp b/lib/Index/IndexSymbol.cpp index 1cdc0984f7..a8f11b3448 100644 --- a/lib/Index/IndexSymbol.cpp +++ b/lib/Index/IndexSymbol.cpp @@ -1,9 +1,8 @@ //===--- IndexSymbol.cpp - Types and functions for indexing symbols -------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -56,9 +55,6 @@ bool index::isFunctionLocalSymbol(const Decl *D) { if (isa<ParmVarDecl>(D)) return true; - if (isa<TemplateTemplateParmDecl>(D)) - return true; - if (isa<ObjCTypeParamDecl>(D)) return true; @@ -320,10 +316,22 @@ SymbolInfo index::getSymbolInfo(const Decl *D) { Info.Lang = SymbolLanguage::CXX; Info.Properties |= (SymbolPropertySet)SymbolProperty::Generic; break; + case Decl::Using: + Info.Kind = SymbolKind::Using; + Info.Lang = SymbolLanguage::CXX; + break; case Decl::Binding: Info.Kind = SymbolKind::Variable; Info.Lang = SymbolLanguage::CXX; break; + case Decl::MSProperty: + Info.Kind = SymbolKind::InstanceProperty; + if (const CXXRecordDecl *CXXRec = + dyn_cast<CXXRecordDecl>(D->getDeclContext())) { + if (!CXXRec->isCLike()) + Info.Lang = SymbolLanguage::CXX; + } + break; default: break; } @@ -388,6 +396,7 @@ bool index::applyForEachSymbolRoleInterruptible(SymbolRoleSet Roles, APPLY_FOR_ROLE(RelationContainedBy); APPLY_FOR_ROLE(RelationIBTypeOf); APPLY_FOR_ROLE(RelationSpecializationOf); + APPLY_FOR_ROLE(NameReference); #undef APPLY_FOR_ROLE @@ -430,6 +439,7 @@ void index::printSymbolRoles(SymbolRoleSet Roles, raw_ostream &OS) { case SymbolRole::RelationContainedBy: OS << "RelCont"; break; case SymbolRole::RelationIBTypeOf: OS << "RelIBType"; break; case SymbolRole::RelationSpecializationOf: OS << "RelSpecialization"; break; + case SymbolRole::NameReference: OS << "NameReference"; break; } }); } diff --git a/lib/Index/IndexTypeSourceInfo.cpp b/lib/Index/IndexTypeSourceInfo.cpp index 85afc63450..9f9740b607 100644 --- a/lib/Index/IndexTypeSourceInfo.cpp +++ b/lib/Index/IndexTypeSourceInfo.cpp @@ -1,9 +1,8 @@ //===- IndexTypeSourceInfo.cpp - Indexing types ---------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -46,6 +45,13 @@ public: return false; \ } while (0) + bool VisitTemplateTypeParmTypeLoc(TemplateTypeParmTypeLoc TTPL) { + SourceLocation Loc = TTPL.getNameLoc(); + TemplateTypeParmDecl *TTPD = TTPL.getDecl(); + return IndexCtx.handleReference(TTPD, Loc, Parent, ParentDC, + SymbolRoleSet()); + } + bool VisitTypedefTypeLoc(TypedefTypeLoc TL) { SourceLocation Loc = TL.getNameLoc(); TypedefNameDecl *ND = TL.getTypedefNameDecl(); @@ -130,10 +136,10 @@ public: template<typename TypeLocType> bool HandleTemplateSpecializationTypeLoc(TypeLocType TL) { if (const auto *T = TL.getTypePtr()) { - if (IndexCtx.shouldIndexImplicitInstantiation()) { - if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) { - IndexCtx.handleReference(RD, TL.getTemplateNameLoc(), - Parent, ParentDC, SymbolRoleSet(), Relations); + if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) { + if (!RD->isImplicit() || IndexCtx.shouldIndexImplicitInstantiation()) { + IndexCtx.handleReference(RD, TL.getTemplateNameLoc(), Parent, + ParentDC, SymbolRoleSet(), Relations); return true; } } diff --git a/lib/Index/IndexingAction.cpp b/lib/Index/IndexingAction.cpp index 5cdec4b452..5a805c4abc 100644 --- a/lib/Index/IndexingAction.cpp +++ b/lib/Index/IndexingAction.cpp @@ -1,9 +1,8 @@ //===- IndexingAction.cpp - Frontend index action -------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/lib/Index/IndexingContext.cpp b/lib/Index/IndexingContext.cpp index bba6c8390b..e298560071 100644 --- a/lib/Index/IndexingContext.cpp +++ b/lib/Index/IndexingContext.cpp @@ -1,9 +1,8 @@ //===- IndexingContext.cpp - Indexing context data ------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -41,6 +40,14 @@ bool IndexingContext::shouldIndexImplicitInstantiation() const { return IndexOpts.IndexImplicitInstantiation; } +bool IndexingContext::shouldIndexParametersInDeclarations() const { + return IndexOpts.IndexParametersInDeclarations; +} + +bool IndexingContext::shouldIndexTemplateParameters() const { + return IndexOpts.IndexTemplateParameters; +} + bool IndexingContext::handleDecl(const Decl *D, SymbolRoleSet Roles, ArrayRef<SymbolRelation> Relations) { @@ -73,8 +80,11 @@ bool IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc, if (!shouldIndexFunctionLocalSymbols() && isFunctionLocalSymbol(D)) return true; - if (isa<NonTypeTemplateParmDecl>(D) || isa<TemplateTypeParmDecl>(D)) + if (!shouldIndexTemplateParameters() && + (isa<NonTypeTemplateParmDecl>(D) || isa<TemplateTypeParmDecl>(D) || + isa<TemplateTemplateParmDecl>(D))) { return true; + } return handleDeclOccurrence(D, Loc, /*IsRef=*/true, Parent, Roles, Relations, RefE, RefD, DC); @@ -322,6 +332,7 @@ static bool shouldReportOccurrenceForSystemDeclOnlyMode( case SymbolRole::RelationCalledBy: case SymbolRole::RelationContainedBy: case SymbolRole::RelationSpecializationOf: + case SymbolRole::NameReference: return true; } llvm_unreachable("Unsupported SymbolRole value!"); @@ -400,10 +411,9 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc, FinalRelations.reserve(Relations.size()+1); auto addRelation = [&](SymbolRelation Rel) { - auto It = std::find_if(FinalRelations.begin(), FinalRelations.end(), - [&](SymbolRelation Elem)->bool { - return Elem.RelatedSymbol == Rel.RelatedSymbol; - }); + auto It = llvm::find_if(FinalRelations, [&](SymbolRelation Elem) -> bool { + return Elem.RelatedSymbol == Rel.RelatedSymbol; + }); if (It != FinalRelations.end()) { It->Roles |= Rel.Roles; } else { diff --git a/lib/Index/IndexingContext.h b/lib/Index/IndexingContext.h index 04960086d0..3136878c08 100644 --- a/lib/Index/IndexingContext.h +++ b/lib/Index/IndexingContext.h @@ -1,9 +1,8 @@ //===- IndexingContext.h - Indexing context data ----------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -62,6 +61,10 @@ public: bool shouldIndexImplicitInstantiation() const; + bool shouldIndexParametersInDeclarations() const; + + bool shouldIndexTemplateParameters() const; + static bool isTemplateImplicitInstantiation(const Decl *D); bool handleDecl(const Decl *D, SymbolRoleSet Roles = SymbolRoleSet(), diff --git a/lib/Index/SimpleFormatContext.h b/lib/Index/SimpleFormatContext.h index 24adcac602..17793154a3 100644 --- a/lib/Index/SimpleFormatContext.h +++ b/lib/Index/SimpleFormatContext.h @@ -1,9 +1,8 @@ //===--- SimpleFormatContext.h ----------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/lib/Index/USRGeneration.cpp b/lib/Index/USRGeneration.cpp index 84ca753bf8..228651de92 100644 --- a/lib/Index/USRGeneration.cpp +++ b/lib/Index/USRGeneration.cpp @@ -1,9 +1,8 @@ //===- USRGeneration.cpp - Routines for USR generation --------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -112,7 +111,12 @@ public: } void VisitUsingDecl(const UsingDecl *D) { - IgnoreResults = true; + VisitDeclContext(D->getDeclContext()); + Out << "@UD@"; + + bool EmittedDeclName = !EmitDeclName(D); + assert(EmittedDeclName && "EmitDeclName can not fail for UsingDecls"); + (void)EmittedDeclName; } bool ShouldGenerateLocation(const NamedDecl *D); @@ -271,7 +275,7 @@ void USRGenerator::VisitFunctionDecl(const FunctionDecl *D) { if (MD->isStatic()) Out << 'S'; // FIXME: OpenCL: Need to consider address spaces - if (unsigned quals = MD->getTypeQualifiers().getCVRUQualifiers()) + if (unsigned quals = MD->getMethodQualifiers().getCVRUQualifiers()) Out << (char)('0' + quals); switch (MD->getRefQualifier()) { case RQ_None: break; |