aboutsummaryrefslogtreecommitdiff
path: root/clang/tools/libclang/CIndexCodeCompletion.cpp
diff options
context:
space:
mode:
authorBill Wendling <5993918+bwendling@users.noreply.github.com>2024-04-11 00:33:40 +0000
committerGitHub <noreply@github.com>2024-04-11 00:33:40 +0000
commitfca51911d4668b3a6b79eb956327eb81fad3f40c (patch)
tree5ecae090dfb59b591c3bdf3eaec984a8093805ca /clang/tools/libclang/CIndexCodeCompletion.cpp
parentbe10070f91b86a6f126d2451852242bfcb2cd366 (diff)
downloadllvm-fca51911d4668b3a6b79eb956327eb81fad3f40c.zip
llvm-fca51911d4668b3a6b79eb956327eb81fad3f40c.tar.gz
llvm-fca51911d4668b3a6b79eb956327eb81fad3f40c.tar.bz2
[NFC][Clang] Improve const correctness for IdentifierInfo (#79365)
The IdentifierInfo isn't typically modified. Use 'const' wherever possible.
Diffstat (limited to 'clang/tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r--clang/tools/libclang/CIndexCodeCompletion.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp
index 3c5f390..850c004 100644
--- a/clang/tools/libclang/CIndexCodeCompletion.cpp
+++ b/clang/tools/libclang/CIndexCodeCompletion.cpp
@@ -601,15 +601,15 @@ namespace {
AllocatedResults.Contexts = getContextsForContextKind(contextKind, S);
AllocatedResults.Selector = "";
- ArrayRef<IdentifierInfo *> SelIdents = Context.getSelIdents();
- for (ArrayRef<IdentifierInfo *>::iterator I = SelIdents.begin(),
- E = SelIdents.end();
+ ArrayRef<const IdentifierInfo *> SelIdents = Context.getSelIdents();
+ for (ArrayRef<const IdentifierInfo *>::iterator I = SelIdents.begin(),
+ E = SelIdents.end();
I != E; ++I) {
- if (IdentifierInfo *selIdent = *I)
+ if (const IdentifierInfo *selIdent = *I)
AllocatedResults.Selector += selIdent->getName();
AllocatedResults.Selector += ":";
}
-
+
QualType baseType = Context.getBaseType();
NamedDecl *D = nullptr;