summaryrefslogtreecommitdiffstats
path: root/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp')
-rw-r--r--build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp b/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
index f6958384a8..5e09e093d0 100644
--- a/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
+++ b/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
@@ -138,6 +138,14 @@ struct RAIITracer {
class IndexConsumer;
+bool isPure(FunctionDecl* D) {
+#if CLANG_VERSION_MAJOR >= 18
+ return D->isPureVirtual();
+#else
+ return D->isPure();
+#endif
+}
+
// For each C++ file seen by the analysis (.cpp or .h), we track a
// FileInfo. This object tracks whether the file is "interesting" (i.e., whether
// it's in the source dir or the objdir). We also store the analysis output
@@ -191,7 +199,12 @@ public:
#endif
StringRef SearchPath,
StringRef RelativePath,
+#if CLANG_VERSION_MAJOR >= 19
+ const Module *SuggestedModule,
+ bool ModuleImported,
+#else
const Module *Imported,
+#endif
SrcMgr::CharacteristicKind FileType) override;
virtual void MacroDefined(const Token &Tok,
@@ -1749,7 +1762,7 @@ public:
D = D2->getTemplateInstantiationPattern();
}
// We treat pure virtual declarations as definitions.
- Kind = (D2->isThisDeclarationADefinition() || D2->isPure()) ? "def" : "decl";
+ Kind = (D2->isThisDeclarationADefinition() || isPure(D2)) ? "def" : "decl";
PrettyKind = "function";
PeekRange = getFunctionPeekRange(D2);
@@ -1881,7 +1894,7 @@ public:
}
}
if (FunctionDecl *D2 = dyn_cast<FunctionDecl>(D)) {
- if ((D2->isThisDeclarationADefinition() || D2->isPure()) &&
+ if ((D2->isThisDeclarationADefinition() || isPure(D2)) &&
// a clause at the top should have generalized and set wasTemplate so
// it shouldn't be the case that isTemplateInstantiation() is true.
!D2->isTemplateInstantiation() &&
@@ -2335,7 +2348,12 @@ void PreprocessorHook::InclusionDirective(SourceLocation HashLoc,
#endif
StringRef SearchPath,
StringRef RelativePath,
+#if CLANG_VERSION_MAJOR >= 19
+ const Module *SuggestedModule,
+ bool ModuleImported,
+#else
const Module *Imported,
+#endif
SrcMgr::CharacteristicKind FileType) {
#if CLANG_VERSION_MAJOR >= 15
if (!File) {