aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authoryronglin <yronglin777@gmail.com>2025-04-17 22:40:47 +0800
committerGitHub <noreply@github.com>2025-04-17 22:40:47 +0800
commitd83b639b4c62924deef504f46e573e7d995ea10d (patch)
treefda59205ff14c0c04d49ec15db174456c5cb42fa /clang/lib/Sema/SemaCodeComplete.cpp
parent78857e7263ba555fb40b286c6b40fcd35a85a65a (diff)
downloadllvm-d83b639b4c62924deef504f46e573e7d995ea10d.zip
llvm-d83b639b4c62924deef504f46e573e7d995ea10d.tar.gz
llvm-d83b639b4c62924deef504f46e573e7d995ea10d.tar.bz2
Reland [clang] Unify `SourceLocation` and `IdentifierInfo*` pair-like data structures to `IdentifierLoc` (#136077)
This PR reland https://github.com/llvm/llvm-project/pull/135808, fixed some missed changes in LLDB. I found this issue when I working on https://github.com/llvm/llvm-project/pull/107168. Currently we have many similiar data structures like: - std::pair<IdentifierInfo *, SourceLocation>. - Element type of ModuleIdPath. - IdentifierLocPair. - IdentifierLoc. This PR unify these data structures to IdentifierLoc, moved IdentifierLoc definition to SourceLocation.h, and deleted other similer data structures. --------- Signed-off-by: yronglin <yronglin777@gmail.com>
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index f6ec4cb..1e4e6fd 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -8718,7 +8718,7 @@ static void AddProtocolResults(DeclContext *Ctx, DeclContext *CurContext,
}
void SemaCodeCompletion::CodeCompleteObjCProtocolReferences(
- ArrayRef<IdentifierLocPair> Protocols) {
+ ArrayRef<IdentifierLoc> Protocols) {
ResultBuilder Results(SemaRef, CodeCompleter->getAllocator(),
CodeCompleter->getCodeCompletionTUInfo(),
CodeCompletionContext::CCC_ObjCProtocolName);
@@ -8729,9 +8729,9 @@ void SemaCodeCompletion::CodeCompleteObjCProtocolReferences(
// Tell the result set to ignore all of the protocols we have
// already seen.
// FIXME: This doesn't work when caching code-completion results.
- for (const IdentifierLocPair &Pair : Protocols)
- if (ObjCProtocolDecl *Protocol =
- SemaRef.ObjC().LookupProtocol(Pair.first, Pair.second))
+ for (const IdentifierLoc &Pair : Protocols)
+ if (ObjCProtocolDecl *Protocol = SemaRef.ObjC().LookupProtocol(
+ Pair.getIdentifierInfo(), Pair.getLoc()))
Results.Ignore(Protocol);
// Add all protocols.