A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://clang.llvm.org/doxygen/ASTImporterLookupTable_8cpp_source.html below:

clang: lib/AST/ASTImporterLookupTable.cpp Source File

17#include "llvm/Support/FormatVariadic.h" 23struct

Builder : RecursiveASTVisitor<Builder> {

24

ASTImporterLookupTable &

LT

;

25

Builder(ASTImporterLookupTable &LT) :

LT

(

LT

) {}

27 bool

VisitTypedefNameDecl(TypedefNameDecl *

D

) {

28

QualType Ty =

D

->getUnderlyingType();

29

Ty = Ty.getCanonicalType();

30 if

(

const auto

*RTy = dyn_cast<RecordType>(Ty)) {

31 LT

.add(RTy->getAsRecordDecl());

33 for

(

auto

*it : RTy->getAsRecordDecl()->fields()) {

40 bool

VisitNamedDecl(NamedDecl *

D

) {

49 bool

VisitFriendDecl(FriendDecl *

D

) {

50 if

(

D

->getFriendType()) {

51

QualType Ty =

D

->getFriendType()->getType();

52 if

(isa<ElaboratedType>(Ty))

53

Ty = cast<ElaboratedType>(Ty)->getNamedType();

58 if

(!Ty->isDependentType()) {

59 if

(

const auto

*RTy = dyn_cast<RecordType>(Ty))

60 LT

.add(RTy->getAsCXXRecordDecl());

61 else if

(

const auto

*SpecTy = dyn_cast<TemplateSpecializationType>(Ty))

62 LT

.add(SpecTy->getAsCXXRecordDecl());

63 else if

(

const auto

*SubstTy =

64

dyn_cast<SubstTemplateTypeParmType>(Ty)) {

65 if

(SubstTy->getAsCXXRecordDecl())

66 LT

.add(SubstTy->getAsCXXRecordDecl());

67

}

else if

(isa<TypedefType>(Ty)) {

70

}

else if

(isa<UsingType>(Ty)) {

73

llvm_unreachable(

"Unhandled type of friend class"

);

81 bool

shouldVisitTemplateInstantiations()

const

{

return true

; }

82 bool

shouldVisitImplicitCode()

const

{

return true

; }

98 if

(

auto

*Ns = dyn_cast<NamespaceDecl>(

D

->getDeclContext()))

100

add(

D

->getDeclContext(),

D

);

105

DeclList &Decls = LookupTable[DC][ND->

getDeclName

()];

110void

ASTImporterLookupTable::remove(DeclContext *DC, NamedDecl *ND) {

111 const

DeclarationName Name = ND->getDeclName();

112

DeclList &Decls = LookupTable[DC][Name];

113 bool

EraseResult = Decls.remove(ND);

117

std::string Message =

119 "Trying to remove not contained Decl '{0}' of type {1} from a {2}"

,

120

Name.getAsString(), ND->getDeclKindName(), DC->getDeclKindName())

122

llvm_unreachable(Message.c_str());

147 "DeclContext should be changed before update"

);

150 "Decl should not be found in the old context if already in the new"

);

159

LookupTable[OldDC][ND->

getDeclName

()].remove(ND);

165 auto

DCI = LookupTable.find(DC);

166 if

(DCI == LookupTable.end())

169 const auto

&FoundNameMap = DCI->second;

170 auto

NamesI = FoundNameMap.find(Name);

171 if

(NamesI == FoundNameMap.end())

174 return

NamesI->second;

182 auto

DCI = LookupTable.find(DC);

183 if

(DCI == LookupTable.end())

184

llvm::errs() <<

"empty\n"

;

185 const auto

&FoundNameMap = DCI->second;

186 for

(

const auto

&Entry : FoundNameMap) {

188

llvm::errs() <<

"==== Name: "

;

190 const DeclList

& List = Entry.second;

198 for

(

const auto

&Entry : LookupTable) {

200

llvm::errs() <<

"== DC:"

<< cast<Decl>(DC) <<

"\n"

;

ASTImporterLookupTable & LT

Decl * getVaListTagDecl() const

Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...

void update(NamedDecl *ND, DeclContext *OldDC)

LookupResult lookup(DeclContext *DC, DeclarationName Name) const

void updateForced(NamedDecl *ND, DeclContext *OldDC)

ASTImporterLookupTable(TranslationUnitDecl &TU)

bool contains(DeclContext *DC, NamedDecl *ND) const

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

DeclContext * getRedeclContext()

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

DeclContext * getDeclContext()

The name of a declaration.

This represents a decl that may have a name.

DeclarationName getDeclName() const

Get the actual, stored name of the declaration, which may be a special name.

The top declaration context.

ASTContext & getASTContext() const

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


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