Mercurial > hg > CbC > CbC_llvm
comparison clang-tools-extra/clangd/FindTarget.cpp @ 223:5f17cb93ff66 llvm-original
LLVM13 (2021/7/18)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 18 Jul 2021 22:43:00 +0900 |
parents | 79ff65ed7e25 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
222:81f6424ef0e3 | 223:5f17cb93ff66 |
---|---|
179 } else if (const UsingDecl *UD = dyn_cast<UsingDecl>(D)) { | 179 } else if (const UsingDecl *UD = dyn_cast<UsingDecl>(D)) { |
180 // no Underlying as this is a non-renaming alias. | 180 // no Underlying as this is a non-renaming alias. |
181 for (const UsingShadowDecl *S : UD->shadows()) | 181 for (const UsingShadowDecl *S : UD->shadows()) |
182 add(S->getUnderlyingDecl(), Flags); | 182 add(S->getUnderlyingDecl(), Flags); |
183 Flags |= Rel::Alias; // continue with the alias. | 183 Flags |= Rel::Alias; // continue with the alias. |
184 } else if (const UsingEnumDecl *UED = dyn_cast<UsingEnumDecl>(D)) { | |
185 add(UED->getEnumDecl(), Flags); | |
186 Flags |= Rel::Alias; // continue with the alias. | |
184 } else if (const auto *NAD = dyn_cast<NamespaceAliasDecl>(D)) { | 187 } else if (const auto *NAD = dyn_cast<NamespaceAliasDecl>(D)) { |
185 add(NAD->getUnderlyingDecl(), Flags | Rel::Underlying); | 188 add(NAD->getUnderlyingDecl(), Flags | Rel::Underlying); |
186 Flags |= Rel::Alias; // continue with the alias | 189 Flags |= Rel::Alias; // continue with the alias |
187 } else if (const UnresolvedUsingValueDecl *UUVD = | 190 } else if (const UnresolvedUsingValueDecl *UUVD = |
188 dyn_cast<UnresolvedUsingValueDecl>(D)) { | 191 dyn_cast<UnresolvedUsingValueDecl>(D)) { |
191 add(Target, Flags); // no Underlying as this is a non-renaming alias | 194 add(Target, Flags); // no Underlying as this is a non-renaming alias |
192 } | 195 } |
193 } | 196 } |
194 Flags |= Rel::Alias; // continue with the alias | 197 Flags |= Rel::Alias; // continue with the alias |
195 } else if (const UsingShadowDecl *USD = dyn_cast<UsingShadowDecl>(D)) { | 198 } else if (const UsingShadowDecl *USD = dyn_cast<UsingShadowDecl>(D)) { |
196 // Include the using decl, but don't traverse it. This may end up | 199 // Include the Introducing decl, but don't traverse it. This may end up |
197 // including *all* shadows, which we don't want. | 200 // including *all* shadows, which we don't want. |
198 report(USD->getUsingDecl(), Flags | Rel::Alias); | 201 report(USD->getIntroducer(), Flags | Rel::Alias); |
199 // Shadow decls are synthetic and not themselves interesting. | 202 // Shadow decls are synthetic and not themselves interesting. |
200 // Record the underlying decl instead, if allowed. | 203 // Record the underlying decl instead, if allowed. |
201 D = USD->getTargetDecl(); | 204 D = USD->getTargetDecl(); |
202 } else if (const auto *DG = dyn_cast<CXXDeductionGuideDecl>(D)) { | 205 } else if (const auto *DG = dyn_cast<CXXDeductionGuideDecl>(D)) { |
203 D = DG->getDeducedTemplate(); | 206 D = DG->getDeducedTemplate(); |