summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/constantparam.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-02-15 15:03:24 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-02-17 21:45:06 +0100
commitd1a2b80b9dc146c7fe63d2657e5506f49d6e5c0d (patch)
tree7ceeb7e977c660d5b69bc93e8327674b7ea1ae5d /compilerplugins/clang/constantparam.cxx
parenteed401bc7429f29f1b21cf8e3b08969e011d5692 (diff)
Bump compiler plugins Clang baseline to 12.0.1
...as discussed in the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2020-November/086234.html> "Bump --enable-compiler-plugins Clang baseline?" (and now picked up again at <https://lists.freedesktop.org/archives/libreoffice/2022-February/088459.html> "Re: Bump --enable-compiler-plugins Clang baseline?"), and clean up compilerplugins/clang/ accordingly Change-Id: I5e81c6fdcc363aeefd6227606225b526fdf7ac16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/constantparam.cxx')
-rw-r--r--compilerplugins/clang/constantparam.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/compilerplugins/clang/constantparam.cxx b/compilerplugins/clang/constantparam.cxx
index da1ee7841ebe..f9f87b361bc5 100644
--- a/compilerplugins/clang/constantparam.cxx
+++ b/compilerplugins/clang/constantparam.cxx
@@ -104,10 +104,6 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde
{
if (functionDecl->getInstantiatedFromMemberFunction())
functionDecl = functionDecl->getInstantiatedFromMemberFunction();
-#if CLANG_VERSION < 90000
- else if (functionDecl->getClassScopeSpecializationPattern())
- functionDecl = functionDecl->getClassScopeSpecializationPattern();
-#endif
else if (functionDecl->getTemplateInstantiationPattern())
functionDecl = functionDecl->getTemplateInstantiationPattern();
@@ -202,8 +198,8 @@ std::string ConstantParam::getCallValue(const Expr* arg)
// Get the expression contents.
// This helps us find params which are always initialised with something like "OUString()".
SourceManager& SM = compiler.getSourceManager();
- SourceLocation startLoc = compat::getBeginLoc(arg);
- SourceLocation endLoc = compat::getEndLoc(arg);
+ SourceLocation startLoc = arg->getBeginLoc();
+ SourceLocation endLoc = arg->getEndLoc();
const char *p1 = SM.getCharacterData( startLoc );
const char *p2 = SM.getCharacterData( endLoc );
if (!p1 || !p2 || (p2 - p1) < 0 || (p2 - p1) > 40) {
@@ -249,10 +245,6 @@ bool ConstantParam::VisitCallExpr(const CallExpr * callExpr) {
// work our way back to the root definition for template methods
if (functionDecl->getInstantiatedFromMemberFunction())
functionDecl = functionDecl->getInstantiatedFromMemberFunction();
-#if CLANG_VERSION < 90000
- else if (functionDecl->getClassScopeSpecializationPattern())
- functionDecl = functionDecl->getClassScopeSpecializationPattern();
-#endif
else if (functionDecl->getTemplateInstantiationPattern())
functionDecl = functionDecl->getTemplateInstantiationPattern();