diff options
author | Bill Wendling <5993918+bwendling@users.noreply.github.com> | 2024-04-11 00:33:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-11 00:33:40 +0000 |
commit | fca51911d4668b3a6b79eb956327eb81fad3f40c (patch) | |
tree | 5ecae090dfb59b591c3bdf3eaec984a8093805ca /clang/tools/libclang/CIndexCodeCompletion.cpp | |
parent | be10070f91b86a6f126d2451852242bfcb2cd366 (diff) | |
download | llvm-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.cpp | 10 |
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; |