README.md                                             |    2 
 compilerplugins/clang/automem.cxx                     |    5 
 compilerplugins/clang/blockblock.cxx                  |   11 
 compilerplugins/clang/bufferadd.cxx                   |    5 
 compilerplugins/clang/buriedassign.cxx                |   49 +--
 compilerplugins/clang/casttovoid.cxx                  |    5 
 compilerplugins/clang/changetoolsgen.cxx              |   35 +-
 compilerplugins/clang/checkconfigmacros.cxx           |    2 
 compilerplugins/clang/checkunusedparams.cxx           |    8 
 compilerplugins/clang/collapseif.cxx                  |    6 
 compilerplugins/clang/colorcheck.cxx                  |    6 
 compilerplugins/clang/commaoperator.cxx               |   10 
 compilerplugins/clang/comparisonwithconstant.cxx      |    7 
 compilerplugins/clang/compat.hxx                      |  236 ------------------
 compilerplugins/clang/conditionalstring.cxx           |    8 
 compilerplugins/clang/constantparam.cxx               |   12 
 compilerplugins/clang/constfields.cxx                 |    9 
 compilerplugins/clang/constfieldsrewrite.cxx          |    3 
 compilerplugins/clang/constmethod.cxx                 |   15 -
 compilerplugins/clang/constparams.cxx                 |   18 -
 compilerplugins/clang/consttobool.cxx                 |   10 
 compilerplugins/clang/constvars.cxx                   |   13 
 compilerplugins/clang/convertlong.cxx                 |    1 
 compilerplugins/clang/countusersofdefaultparams.cxx   |   19 -
 compilerplugins/clang/cow_wrapper.cxx                 |    4 
 compilerplugins/clang/cstylecast.cxx                  |    6 
 compilerplugins/clang/datamembershadow.cxx            |    7 
 compilerplugins/clang/dbgunhandledexception.cxx       |    8 
 compilerplugins/clang/derefnullptr.cxx                |    2 
 compilerplugins/clang/dodgyswitch.cxx                 |    4 
 compilerplugins/clang/doubleconvert.cxx               |    3 
 compilerplugins/clang/dyncastvisibility.cxx           |    2 
 compilerplugins/clang/elidestringvar.cxx              |    5 
 compilerplugins/clang/empty.cxx                       |    3 
 compilerplugins/clang/emptyif.cxx                     |    5 
 compilerplugins/clang/expandablemethods.cxx           |    9 
 compilerplugins/clang/expressionalwayszero.cxx        |    8 
 compilerplugins/clang/externandnotdefined.cxx         |    2 
 compilerplugins/clang/faileddyncast.cxx               |    2 
 compilerplugins/clang/fakebool.cxx                    |   35 +-
 compilerplugins/clang/finalclasses.cxx                |    3 
 compilerplugins/clang/flatten.cxx                     |    8 
 compilerplugins/clang/fragiledestructor.cxx           |   10 
 compilerplugins/clang/getstr.cxx                      |    3 
 compilerplugins/clang/implicitboolconversion.cxx      |   35 --
 compilerplugins/clang/includeform.cxx                 |    6 
 compilerplugins/clang/indentation.cxx                 |   46 ---
 compilerplugins/clang/inlinesimplememberfunctions.cxx |   11 
 compilerplugins/clang/intvsfloat.cxx                  |    7 
 compilerplugins/clang/literaltoboolconversion.cxx     |   24 -
 compilerplugins/clang/logexceptionnicely.cxx          |    6 
 compilerplugins/clang/loopvartoosmall.cxx             |    1 
 compilerplugins/clang/makeshared.cxx                  |   15 -
 compilerplugins/clang/memoryvar.cxx                   |    1 
 compilerplugins/clang/mergeclasses.cxx                |    3 
 compilerplugins/clang/methodcycles.cxx                |    6 
 compilerplugins/clang/moveparam.cxx                   |   14 -
 compilerplugins/clang/namespaceindentation.cxx        |   18 -
 compilerplugins/clang/noexceptmove.cxx                |    9 
 compilerplugins/clang/nullptr.cxx                     |   12 
 compilerplugins/clang/oncevar.cxx                     |    3 
 compilerplugins/clang/plugin.cxx                      |    7 
 compilerplugins/clang/plugin.hxx                      |   12 
 compilerplugins/clang/pluginhandler.cxx               |   16 -
 compilerplugins/clang/pointerbool.cxx                 |    1 
 compilerplugins/clang/privatebase.cxx                 |    2 
 compilerplugins/clang/rangedforcopy.cxx               |    2 
 compilerplugins/clang/reducevarscope.cxx              |    3 
 compilerplugins/clang/redundantcast.cxx               |   20 -
 compilerplugins/clang/redundantfcast.cxx              |    4 
 compilerplugins/clang/redundantinline.cxx             |   12 
 compilerplugins/clang/redundantpointerops.cxx         |   15 -
 compilerplugins/clang/redundantstatic.cxx             |    5 
 compilerplugins/clang/refcounting.cxx                 |   35 +-
 compilerplugins/clang/referencecasting.cxx            |   44 +--
 compilerplugins/clang/rendercontext.cxx               |    2 
 compilerplugins/clang/reservedid.cxx                  |    2 
 compilerplugins/clang/returnconstant.cxx              |   13 
 compilerplugins/clang/salcall.cxx                     |   18 -
 compilerplugins/clang/sallogareas.cxx                 |   10 
 compilerplugins/clang/salunicodeliteral.cxx           |    2 
 compilerplugins/clang/sequentialassign.cxx            |    7 
 compilerplugins/clang/sfxpoolitem.cxx                 |    2 
 compilerplugins/clang/sharedvisitor/analyzer.cxx      |    4 
 compilerplugins/clang/shouldreturnbool.cxx            |    7 
 compilerplugins/clang/simplifyconstruct.cxx           |    4 
 compilerplugins/clang/simplifydynamiccast.cxx         |    7 
 compilerplugins/clang/simplifypointertobool.cxx       |   19 -
 compilerplugins/clang/singlevalfields.cxx             |    8 
 compilerplugins/clang/staticaccess.cxx                |    2 
 compilerplugins/clang/staticconstfield.cxx            |    2 
 compilerplugins/clang/staticdynamic.cxx               |   16 -
 compilerplugins/clang/staticmethods.cxx               |    6 
 compilerplugins/clang/staticvar.cxx                   |    1 
 compilerplugins/clang/store/finalprotected.cxx        |    4 
 compilerplugins/clang/store/optmove.cxx               |    6 
 compilerplugins/clang/store/refassign.cxx             |    3 
 compilerplugins/clang/store/simplifybool.cxx          |  155 +++++------
 compilerplugins/clang/store/stringbuffer.cxx          |    5 
 compilerplugins/clang/stringadd.cxx                   |   11 
 compilerplugins/clang/stringconcatauto.cxx            |    4 
 compilerplugins/clang/stringconcatliterals.cxx        |   12 
 compilerplugins/clang/stringconstant.cxx              |   42 +--
 compilerplugins/clang/stringliteraldefine.cxx         |   10 
 compilerplugins/clang/stringliteralvar.cxx            |    2 
 compilerplugins/clang/stringloop.cxx                  |    9 
 compilerplugins/clang/stringstatic.cxx                |    7 
 compilerplugins/clang/stringview.cxx                  |   10 
 compilerplugins/clang/stringviewparam.cxx             |    7 
 compilerplugins/clang/test/indentation.cxx            |    4 
 compilerplugins/clang/test/noexceptmove.cxx           |    7 
 compilerplugins/clang/test/referencecasting.cxx       |    5 
 compilerplugins/clang/test/unusedfields.cxx           |    5 
 compilerplugins/clang/test/unusedvarsglobal.cxx       |    5 
 compilerplugins/clang/toolslong.cxx                   |   48 +--
 compilerplugins/clang/typedefparam.cxx                |   12 
 compilerplugins/clang/unicodetochar.cxx               |    1 
 compilerplugins/clang/unnecessarycatchthrow.cxx       |    3 
 compilerplugins/clang/unnecessaryoverride.cxx         |    5 
 compilerplugins/clang/unnecessaryparen.cxx            |   69 ++---
 compilerplugins/clang/unnecessaryvirtual.cxx          |    1 
 compilerplugins/clang/unoany.cxx                      |    9 
 compilerplugins/clang/unoquery.cxx                    |    3 
 compilerplugins/clang/unsignedcompare.cxx             |    9 
 compilerplugins/clang/unusedenumconstants.cxx         |    6 
 compilerplugins/clang/unusedfields.cxx                |   38 +-
 compilerplugins/clang/unusedfieldsremove.cxx          |    3 
 compilerplugins/clang/unusedindex.cxx                 |    3 
 compilerplugins/clang/unusedmember.cxx                |   38 --
 compilerplugins/clang/unusedmethods.cxx               |   16 -
 compilerplugins/clang/unusedmethodsremove.cxx         |    4 
 compilerplugins/clang/unusedvariablemore.cxx          |    2 
 compilerplugins/clang/unusedvariableplus.cxx          |    1 
 compilerplugins/clang/unusedvarsglobal.cxx            |   28 --
 compilerplugins/clang/useuniqueptr.cxx                |   29 +-
 compilerplugins/clang/vclwidgets.cxx                  |   27 +-
 compilerplugins/clang/virtualdead.cxx                 |    4 
 compilerplugins/clang/virtualdown.cxx                 |    1 
 compilerplugins/clang/weakbase.cxx                    |    4 
 compilerplugins/clang/weakobject.cxx                  |    2 
 compilerplugins/clang/writeonlyvars.cxx               |   37 --
 compilerplugins/clang/xmlimport.cxx                   |   51 +--
 configure.ac                                          |    5 
 143 files changed, 727 insertions(+), 1196 deletions(-)

New commits:
commit d1a2b80b9dc146c7fe63d2657e5506f49d6e5c0d
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Feb 15 15:03:24 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Feb 17 21:45:06 2022 +0100

    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 <sberg...@redhat.com>

diff --git a/README.md b/README.md
index 546330ac86cb..5679f779be46 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ run and compile LibreOffice, also used by the TDF builds:
     * See README.wasm
 
 If you want to use Clang with the LibreOffice compiler plugins, the minimal
-version of Clang is 5.0.2. Since Xcode doesn't provide the compiler plugin
+version of Clang is 12.0.1. Since Xcode doesn't provide the compiler plugin
 headers, you have to compile your own Clang to use them on macOS.
 
 You can find the TDF configure switches in the `distro-configs/` directory.
diff --git a/compilerplugins/clang/automem.cxx 
b/compilerplugins/clang/automem.cxx
index 099c05458e13..92478b9fbb95 100644
--- a/compilerplugins/clang/automem.cxx
+++ b/compilerplugins/clang/automem.cxx
@@ -13,6 +13,7 @@
 #include <iostream>
 #include <fstream>
 #include <set>
+#include "config_clang.h"
 #include "plugin.hxx"
 
 /**
@@ -51,7 +52,7 @@ bool AutoMem::VisitCXXDeleteExpr(const CXXDeleteExpr* expr)
 {
     if (ignoreLocation( expr ))
         return true;
-    StringRef aFileName = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(expr)));
+    StringRef aFileName = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(expr->getBeginLoc()));
     if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/salhelper/")
         || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/osl/")
         || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/salhelper/")
@@ -79,7 +80,7 @@ bool AutoMem::VisitCXXDeleteExpr(const CXXDeleteExpr* expr)
     report(
         DiagnosticsEngine::Warning,
         "calling delete on object field, rather use std::unique_ptr or 
std::scoped_ptr",
-        compat::getBeginLoc(expr))
+        expr->getBeginLoc())
         << expr->getSourceRange();
     return true;
 }
diff --git a/compilerplugins/clang/blockblock.cxx 
b/compilerplugins/clang/blockblock.cxx
index f1d9ec7a9d61..bfcb0206df0f 100644
--- a/compilerplugins/clang/blockblock.cxx
+++ b/compilerplugins/clang/blockblock.cxx
@@ -14,6 +14,7 @@
 #include <iostream>
 #include <fstream>
 #include <set>
+#include "config_clang.h"
 #include "plugin.hxx"
 
 /**
@@ -55,9 +56,9 @@ bool BlockBlock::VisitCompoundStmt(CompoundStmt const * 
compound)
     auto inner = *compound->body_begin();
     if (!isa<CompoundStmt>(inner))
         return true;
-    if 
(compiler.getSourceManager().isMacroBodyExpansion(compat::getBeginLoc(compound)))
+    if 
(compiler.getSourceManager().isMacroBodyExpansion(compound->getBeginLoc()))
         return true;
-    if 
(compiler.getSourceManager().isMacroBodyExpansion(compat::getBeginLoc(inner)))
+    if (compiler.getSourceManager().isMacroBodyExpansion(inner->getBeginLoc()))
         return true;
     if (containsPreprocessingConditionalInclusion(compound->getSourceRange())) 
{
         return true;
@@ -65,12 +66,12 @@ bool BlockBlock::VisitCompoundStmt(CompoundStmt const * 
compound)
     report(
         DiagnosticsEngine::Warning,
         "block directly inside block",
-         compat::getBeginLoc(compound))
+         compound->getBeginLoc())
         << compound->getSourceRange();
     report(
         DiagnosticsEngine::Note,
         "inner block here",
-         compat::getBeginLoc(inner))
+         inner->getBeginLoc())
         << inner->getSourceRange();
     return true;
 }
@@ -94,7 +95,7 @@ bool BlockBlock::VisitCaseStmt(CaseStmt const * caseStmt)
     report(
         DiagnosticsEngine::Warning,
         "block directly inside block",
-         compat::getBeginLoc(compoundStmt))
+         compoundStmt->getBeginLoc())
         << compoundStmt->getSourceRange();
     return true;
 }
diff --git a/compilerplugins/clang/bufferadd.cxx 
b/compilerplugins/clang/bufferadd.cxx
index cf2b6a011b4a..7b3eaf7e416e 100644
--- a/compilerplugins/clang/bufferadd.cxx
+++ b/compilerplugins/clang/bufferadd.cxx
@@ -15,6 +15,7 @@
 
 #include "plugin.hxx"
 #include "check.hxx"
+#include "config_clang.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/StmtVisitor.h"
 
@@ -65,7 +66,7 @@ public:
                 && badMap.find(pair.first) == badMap.end())
                 report(DiagnosticsEngine::Warning,
                        "convert this append sequence into a *String + 
sequence",
-                       compat::getBeginLoc(pair.first))
+                       pair.first->getBeginLoc())
                     << pair.first->getSourceRange();
     }
 
@@ -290,7 +291,7 @@ bool BufferAdd::isMethodOkToMerge(CXXMemberCallExpr const* 
memberCall)
 
 Expr const* BufferAdd::ignore(Expr const* expr)
 {
-    return 
compat::IgnoreImplicit(compat::IgnoreImplicit(expr)->IgnoreParens());
+    return expr->IgnoreImplicit()->IgnoreParens()->IgnoreImplicit();
 }
 
 bool BufferAdd::isSideEffectFree(Expr const* expr)
diff --git a/compilerplugins/clang/buriedassign.cxx 
b/compilerplugins/clang/buriedassign.cxx
index e1932c821e21..acc8bfe7dd67 100644
--- a/compilerplugins/clang/buriedassign.cxx
+++ b/compilerplugins/clang/buriedassign.cxx
@@ -14,6 +14,7 @@
 
 #include "plugin.hxx"
 #include "check.hxx"
+#include "config_clang.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/StmtVisitor.h"
 
@@ -257,13 +258,13 @@ static bool isAssignmentOp(clang::OverloadedOperatorKind 
Opc)
 
 static const Expr* IgnoreImplicitAndConversionOperator(const Expr* expr)
 {
-    expr = compat::IgnoreImplicit(expr);
+    expr = expr->IgnoreImplicit();
     if (auto memberCall = dyn_cast<CXXMemberCallExpr>(expr))
     {
         if (auto conversionDecl = 
dyn_cast_or_null<CXXConversionDecl>(memberCall->getMethodDecl()))
         {
             if (!conversionDecl->isExplicit())
-                expr = 
compat::IgnoreImplicit(memberCall->getImplicitObjectArgument());
+                expr = 
memberCall->getImplicitObjectArgument()->IgnoreImplicit();
         }
     }
     return expr;
@@ -273,7 +274,7 @@ bool BuriedAssign::VisitBinaryOperator(BinaryOperator 
const* binaryOp)
 {
     if (ignoreLocation(binaryOp))
         return true;
-    if (compat::getBeginLoc(binaryOp).isMacroID())
+    if (binaryOp->getBeginLoc().isMacroID())
         return true;
     if (!isAssignmentOp(binaryOp->getOpcode()))
         return true;
@@ -302,12 +303,12 @@ bool BuriedAssign::VisitBinaryOperator(BinaryOperator 
const* binaryOp)
 
     // assignment in constructor
     StringRef aFileName = getFilenameOfLocation(
-        
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(binaryOp)));
+        compiler.getSourceManager().getSpellingLoc(binaryOp->getBeginLoc()));
     if (loplugin::hasPathnamePrefix(aFileName, SRCDIR 
"/include/comphelper/flagguard.hxx"))
         return true;
 
     report(DiagnosticsEngine::Warning, "buried assignment, rather put on own 
line",
-           compat::getBeginLoc(binaryOp))
+           binaryOp->getBeginLoc())
         << binaryOp->getSourceRange();
     
//getParentStmt(getParentStmt(getParentStmt(getParentStmt(getParentStmt(getParentStmt(binaryOp))))))->dump();
     return true;
@@ -317,7 +318,7 @@ bool 
BuriedAssign::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const* cxxOper)
 {
     if (ignoreLocation(cxxOper))
         return true;
-    if (compat::getBeginLoc(cxxOper).isMacroID())
+    if (cxxOper->getBeginLoc().isMacroID())
         return true;
     if (!isAssignmentOp(cxxOper->getOperator()))
         return true;
@@ -344,7 +345,7 @@ bool 
BuriedAssign::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const* cxxOper)
     if (!m_handled.insert(cxxOper).second)
         return true;
     report(DiagnosticsEngine::Warning, "buried assignment, rather put on own 
line",
-           compat::getBeginLoc(cxxOper))
+           cxxOper->getBeginLoc())
         << cxxOper->getSourceRange();
     
//getParentStmt(getParentStmt(getParentStmt(getParentStmt(getParentStmt(cxxOper)))))->dump();
     return true;
@@ -358,7 +359,7 @@ bool BuriedAssign::VisitCompoundStmt(CompoundStmt const* 
compoundStmt)
     {
         if (auto expr = dyn_cast<Expr>(*i))
         {
-            expr = compat::IgnoreImplicit(expr);
+            expr = expr->IgnoreImplicit();
             if (auto binaryOp = dyn_cast<BinaryOperator>(expr))
             {
                 // ignore comma-chained statements at this level
@@ -379,7 +380,7 @@ void BuriedAssign::MarkIfAssignment(Stmt const* stmt)
 {
     if (auto expr = dyn_cast_or_null<Expr>(stmt))
     {
-        expr = compat::IgnoreImplicit(expr);
+        expr = expr->IgnoreImplicit();
         if (auto binaryOp = dyn_cast<BinaryOperator>(expr))
         {
             if (isAssignmentOp(binaryOp->getOpcode()))
@@ -434,7 +435,7 @@ bool BuriedAssign::VisitIfStmt(IfStmt const* ifStmt)
         if (isAssignmentOp(binaryOp->getOpcode()))
         {
             report(DiagnosticsEngine::Warning, "buried assignment, rather put 
on own line",
-                   compat::getBeginLoc(expr))
+                   expr->getBeginLoc())
                 << expr->getSourceRange();
         }
         else if (binaryOp->isComparisonOp())
@@ -446,7 +447,7 @@ bool BuriedAssign::VisitIfStmt(IfStmt const* ifStmt)
                     && 
binaryOp->getRHS()->isCXX11ConstantExpr(compiler.getASTContext())
                     && isAssignmentOp(binaryOp2->getOpcode()))
                     report(DiagnosticsEngine::Warning, "buried assignment, 
rather put on own line",
-                           compat::getBeginLoc(expr))
+                           expr->getBeginLoc())
                         << expr->getSourceRange();
             }
             if (auto binaryOp2
@@ -456,7 +457,7 @@ bool BuriedAssign::VisitIfStmt(IfStmt const* ifStmt)
                     && 
binaryOp->getLHS()->isCXX11ConstantExpr(compiler.getASTContext())
                     && isAssignmentOp(binaryOp2->getOpcode()))
                     report(DiagnosticsEngine::Warning, "buried assignment, 
rather put on own line",
-                           compat::getBeginLoc(expr))
+                           expr->getBeginLoc())
                         << expr->getSourceRange();
             }
         }
@@ -467,7 +468,7 @@ bool BuriedAssign::VisitIfStmt(IfStmt const* ifStmt)
             {
                 if (isAssignmentOp(binaryOp2->getOpcode()))
                     report(DiagnosticsEngine::Warning, "buried assignment, 
rather put on own line",
-                           compat::getBeginLoc(expr))
+                           expr->getBeginLoc())
                         << expr->getSourceRange();
             }
         }
@@ -479,7 +480,7 @@ bool BuriedAssign::VisitIfStmt(IfStmt const* ifStmt)
         if (isAssignmentOp(operCall->getOperator()))
         {
             report(DiagnosticsEngine::Warning, "buried assignment, rather put 
on own line",
-                   compat::getBeginLoc(expr))
+                   expr->getBeginLoc())
                 << expr->getSourceRange();
         }
     }
@@ -531,7 +532,7 @@ void BuriedAssign::MarkConditionForControlLoops(Expr const* 
expr)
 {
     if (!expr)
         return;
-    expr = compat::IgnoreImplicit(expr);
+    expr = expr->IgnoreImplicit();
 
     if (auto binaryOp = dyn_cast<BinaryOperator>(expr))
     {
@@ -550,7 +551,7 @@ void BuriedAssign::MarkConditionForControlLoops(Expr const* 
expr)
         if (memberCall->getMethodDecl() && 
isa<CXXConversionDecl>(memberCall->getMethodDecl()))
         {
             // TODO check that the conversion is converting to bool
-            expr = 
compat::IgnoreImplicit(memberCall->getImplicitObjectArgument());
+            expr = memberCall->getImplicitObjectArgument()->IgnoreImplicit();
         }
     }
 
@@ -559,31 +560,31 @@ void BuriedAssign::MarkConditionForControlLoops(Expr 
const* expr)
         // handle: ((xxx = foo()) != error)
         if (binaryOp->isComparisonOp())
         {
-            
MarkIfAssignment(compat::IgnoreImplicit(binaryOp->getLHS())->IgnoreParens());
-            
MarkIfAssignment(compat::IgnoreImplicit(binaryOp->getRHS())->IgnoreParens());
+            
MarkIfAssignment(binaryOp->getLHS()->IgnoreImplicit()->IgnoreParens());
+            
MarkIfAssignment(binaryOp->getRHS()->IgnoreImplicit()->IgnoreParens());
         }
     }
     else if (auto cxxOper = dyn_cast<CXXOperatorCallExpr>(expr))
     {
         // handle: ((xxx = foo()) != error)
-        if (compat::isComparisonOp(cxxOper))
+        if (cxxOper->isComparisonOp())
         {
-            
MarkIfAssignment(compat::IgnoreImplicit(cxxOper->getArg(0))->IgnoreParens());
-            
MarkIfAssignment(compat::IgnoreImplicit(cxxOper->getArg(1))->IgnoreParens());
+            
MarkIfAssignment(cxxOper->getArg(0)->IgnoreImplicit()->IgnoreParens());
+            
MarkIfAssignment(cxxOper->getArg(1)->IgnoreImplicit()->IgnoreParens());
         }
         // handle: (!(xxx = foo()))
         else if (cxxOper->getOperator() == OO_Exclaim)
-            
MarkIfAssignment(compat::IgnoreImplicit(cxxOper->getArg(0))->IgnoreParens());
+            
MarkIfAssignment(cxxOper->getArg(0)->IgnoreImplicit()->IgnoreParens());
     }
     else if (auto parenExpr = dyn_cast<ParenExpr>(expr))
     {
         // handle: ((xxx = foo()))
-        MarkIfAssignment(compat::IgnoreImplicit(parenExpr->getSubExpr()));
+        MarkIfAssignment(parenExpr->getSubExpr()->IgnoreImplicit());
     }
     else if (auto unaryOp = dyn_cast<UnaryOperator>(expr))
     {
         // handle: (!(xxx = foo()))
-        
MarkIfAssignment(compat::IgnoreImplicit(unaryOp->getSubExpr())->IgnoreParens());
+        
MarkIfAssignment(unaryOp->getSubExpr()->IgnoreImplicit()->IgnoreParens());
     }
     else
         MarkIfAssignment(expr);
diff --git a/compilerplugins/clang/casttovoid.cxx 
b/compilerplugins/clang/casttovoid.cxx
index 1717fa09a516..63f1efdd85a5 100644
--- a/compilerplugins/clang/casttovoid.cxx
+++ b/compilerplugins/clang/casttovoid.cxx
@@ -15,7 +15,6 @@
 #include "clang/AST/Attr.h"
 
 #include "check.hxx"
-#include "compat.hxx"
 #include "plugin.hxx"
 
 namespace {
@@ -464,7 +463,7 @@ private:
             return nullptr;
         }
         if (compiler.getSourceManager().isMacroBodyExpansion(
-                compat::getBeginLoc(expr)))
+                expr->getBeginLoc()))
         {
             return nullptr;
         }
@@ -511,7 +510,7 @@ private:
         if (usage.firstConsumption != nullptr) {
             return;
         }
-        auto const loc = compat::getBeginLoc(dre);
+        auto const loc = dre->getBeginLoc();
         if (compiler.getSourceManager().isMacroArgExpansion(loc)
             && (Lexer::getImmediateMacroNameForDiagnostics(
                     loc, compiler.getSourceManager(), compiler.getLangOpts())
diff --git a/compilerplugins/clang/changetoolsgen.cxx 
b/compilerplugins/clang/changetoolsgen.cxx
index a8e9faf74014..f4b9b6168a57 100644
--- a/compilerplugins/clang/changetoolsgen.cxx
+++ b/compilerplugins/clang/changetoolsgen.cxx
@@ -111,7 +111,7 @@ bool 
ChangeToolsGen::VisitCXXMemberCallExpr(CXXMemberCallExpr const* call)
     if (auto unaryOp = dyn_cast<UnaryOperator>(parent))
     {
         if (!ChangeUnaryOperator(unaryOp, call, methodName))
-            report(DiagnosticsEngine::Warning, "Could not fix, unary", 
compat::getBeginLoc(call));
+            report(DiagnosticsEngine::Warning, "Could not fix, unary", 
call->getBeginLoc());
         return true;
     }
     auto binaryOp = dyn_cast<BinaryOperator>(parent);
@@ -130,7 +130,7 @@ bool 
ChangeToolsGen::VisitCXXMemberCallExpr(CXXMemberCallExpr const* call)
         if (parent2 && isa<Expr>(parent2))
         {
             report(DiagnosticsEngine::Warning, "Could not fix, embedded 
assign",
-                   compat::getBeginLoc(call));
+                   call->getBeginLoc());
             return true;
         }
         // Check for
@@ -139,25 +139,25 @@ bool 
ChangeToolsGen::VisitCXXMemberCallExpr(CXXMemberCallExpr const* call)
             if (rhs->getOpcode() == BO_Assign)
             {
                 report(DiagnosticsEngine::Warning, "Could not fix, double 
assign",
-                       compat::getBeginLoc(call));
+                       call->getBeginLoc());
                 return true;
             }
         if (!ChangeAssignment(parent, methodName, setPrefix))
-            report(DiagnosticsEngine::Warning, "Could not fix, assign", 
compat::getBeginLoc(call));
+            report(DiagnosticsEngine::Warning, "Could not fix, assign", 
call->getBeginLoc());
         return true;
     }
     if (opcode == BO_AddAssign || opcode == BO_SubAssign)
     {
         if (!ChangeBinaryOperatorPlusMinus(binaryOp, call, methodName))
             report(DiagnosticsEngine::Warning, "Could not fix, 
assign-and-change",
-                   compat::getBeginLoc(call));
+                   call->getBeginLoc());
         return true;
     }
     else if (opcode == BO_RemAssign || opcode == BO_MulAssign || opcode == 
BO_DivAssign)
     {
         if (!ChangeBinaryOperatorOther(binaryOp, call, methodName, setPrefix))
             report(DiagnosticsEngine::Warning, "Could not fix, 
assign-and-change",
-                   compat::getBeginLoc(call));
+                   call->getBeginLoc());
         return true;
     }
     else
@@ -173,8 +173,8 @@ bool ChangeToolsGen::ChangeAssignment(Stmt const* parent, 
std::string const& met
     // and replace with
     //    aRect.SetLeft( ... );
     SourceManager& SM = compiler.getSourceManager();
-    SourceLocation startLoc = SM.getExpansionLoc(compat::getBeginLoc(parent));
-    SourceLocation endLoc = SM.getExpansionLoc(compat::getEndLoc(parent));
+    SourceLocation startLoc = SM.getExpansionLoc(parent->getBeginLoc());
+    SourceLocation endLoc = SM.getExpansionLoc(parent->getEndLoc());
     const char* p1 = SM.getCharacterData(startLoc);
     const char* p2 = SM.getCharacterData(endLoc);
     unsigned n = Lexer::MeasureTokenLength(endLoc, SM, compiler.getLangOpts());
@@ -201,8 +201,8 @@ bool 
ChangeToolsGen::ChangeBinaryOperatorPlusMinus(BinaryOperator const* binaryO
     // and replace with
     //    aRect.MoveLeft( ... );
     SourceManager& SM = compiler.getSourceManager();
-    SourceLocation startLoc = 
SM.getExpansionLoc(compat::getBeginLoc(binaryOp));
-    SourceLocation endLoc = SM.getExpansionLoc(compat::getEndLoc(binaryOp));
+    SourceLocation startLoc = SM.getExpansionLoc(binaryOp->getBeginLoc());
+    SourceLocation endLoc = SM.getExpansionLoc(binaryOp->getEndLoc());
     const char* p1 = SM.getCharacterData(startLoc);
     const char* p2 = SM.getCharacterData(endLoc);
     if (p2 < p1) // clang is misbehaving, appears to be macro constant related
@@ -228,7 +228,7 @@ bool 
ChangeToolsGen::ChangeBinaryOperatorPlusMinus(BinaryOperator const* binaryO
     if (newText == callText)
     {
         report(DiagnosticsEngine::Warning, "binaryop-plusminus regex match 
failed",
-               compat::getBeginLoc(call));
+               call->getBeginLoc());
         return false;
     }
 
@@ -245,8 +245,8 @@ bool 
ChangeToolsGen::ChangeBinaryOperatorOther(BinaryOperator const* binaryOp,
     // and replace with
     //    aRect.SetLeft( aRect.GetLeft() + ... );
     SourceManager& SM = compiler.getSourceManager();
-    SourceLocation startLoc = 
SM.getExpansionLoc(compat::getBeginLoc(binaryOp));
-    SourceLocation endLoc = SM.getExpansionLoc(compat::getEndLoc(binaryOp));
+    SourceLocation startLoc = SM.getExpansionLoc(binaryOp->getBeginLoc());
+    SourceLocation endLoc = SM.getExpansionLoc(binaryOp->getEndLoc());
     const char* p1 = SM.getCharacterData(startLoc);
     const char* p2 = SM.getCharacterData(endLoc);
     if (p2 < p1) // clang is misbehaving, appears to be macro constant related
@@ -284,7 +284,7 @@ bool 
ChangeToolsGen::ChangeBinaryOperatorOther(BinaryOperator const* binaryOp,
     if (newText == callText)
     {
         report(DiagnosticsEngine::Warning, "binaryop-other regex match failed 
%0",
-               compat::getBeginLoc(call))
+               call->getBeginLoc())
             << reString;
         return false;
     }
@@ -308,8 +308,8 @@ bool ChangeToolsGen::ChangeUnaryOperator(UnaryOperator 
const* unaryOp,
     //    aRect.MoveLeft( 1 );
 
     SourceManager& SM = compiler.getSourceManager();
-    SourceLocation startLoc = SM.getExpansionLoc(compat::getBeginLoc(unaryOp));
-    SourceLocation endLoc = SM.getExpansionLoc(compat::getEndLoc(unaryOp));
+    SourceLocation startLoc = SM.getExpansionLoc(unaryOp->getBeginLoc());
+    SourceLocation endLoc = SM.getExpansionLoc(unaryOp->getEndLoc());
     const char* p1 = SM.getCharacterData(startLoc);
     const char* p2 = SM.getCharacterData(endLoc);
     if (p2 < p1) // clang is misbehaving, appears to be macro constant related
@@ -352,8 +352,7 @@ bool ChangeToolsGen::ChangeUnaryOperator(UnaryOperator 
const* unaryOp,
     }
     if (newText == callText)
     {
-        report(DiagnosticsEngine::Warning, "unaryop regex match failed %0",
-               compat::getBeginLoc(call))
+        report(DiagnosticsEngine::Warning, "unaryop regex match failed %0", 
call->getBeginLoc())
             << reString;
         return false;
     }
diff --git a/compilerplugins/clang/checkconfigmacros.cxx 
b/compilerplugins/clang/checkconfigmacros.cxx
index 6daa9ed2a17e..aea60ed561b5 100644
--- a/compilerplugins/clang/checkconfigmacros.cxx
+++ b/compilerplugins/clang/checkconfigmacros.cxx
@@ -14,6 +14,8 @@
 
 #include "plugin.hxx"
 
+#include "config_clang.h"
+
 #include <clang/Lex/Preprocessor.h>
 
 namespace loplugin
diff --git a/compilerplugins/clang/checkunusedparams.cxx 
b/compilerplugins/clang/checkunusedparams.cxx
index fa930ba959c8..2f45049632d3 100644
--- a/compilerplugins/clang/checkunusedparams.cxx
+++ b/compilerplugins/clang/checkunusedparams.cxx
@@ -12,6 +12,8 @@
 #include <set>
 #include <iostream>
 
+#include "config_clang.h"
+
 #include "plugin.hxx"
 
 /**
@@ -205,7 +207,7 @@ bool CheckUnusedParams::VisitFunctionDecl(FunctionDecl 
const * decl) {
         return true;
     if 
(isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(canon->getLocation())))
         return true;
-    StringRef fn = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(canon)));
+    StringRef fn = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(canon->getBeginLoc()));
     // Some backwards compat magic.
     // TODO Can probably be removed, but need to do some checking
     if (loplugin::isSamePathname(fn, SRCDIR "/include/sax/fshelper.hxx"))
@@ -477,7 +479,7 @@ bool CheckUnusedParams::VisitFunctionDecl(FunctionDecl 
const * decl) {
                 continue;
         }
         report( DiagnosticsEngine::Warning,
-                "unused param %0 in %1", compat::getBeginLoc(param))
+                "unused param %0 in %1", param->getBeginLoc())
                 << param->getSourceRange()
                 << param->getName()
                 << fqn;
@@ -486,7 +488,7 @@ bool CheckUnusedParams::VisitFunctionDecl(FunctionDecl 
const * decl) {
             unsigned idx = param->getFunctionScopeIndex();
             const ParmVarDecl* pOther = canon->getParamDecl(idx);
             report( DiagnosticsEngine::Note, "declaration is here",
-                    compat::getBeginLoc(pOther))
+                    pOther->getBeginLoc())
                     << pOther->getSourceRange();
         }
     }
diff --git a/compilerplugins/clang/collapseif.cxx 
b/compilerplugins/clang/collapseif.cxx
index b3f192c2ce1d..c50bf3352440 100644
--- a/compilerplugins/clang/collapseif.cxx
+++ b/compilerplugins/clang/collapseif.cxx
@@ -77,7 +77,7 @@ bool CollapseIf::VisitIfStmt(IfStmt const* ifStmt)
         return true;
 
     report(DiagnosticsEngine::Warning, "nested if should be collapsed into one 
statement %0 %1",
-           compat::getBeginLoc(ifStmt))
+           ifStmt->getBeginLoc())
         << noChars1 << noChars2 << ifStmt->getSourceRange();
     return true;
 }
@@ -88,8 +88,8 @@ int CollapseIf::getNoCharsInSourceCodeOfExpr(IfStmt const* 
ifStmt)
     // measuring the size of the condition expression is unreliable, because 
clang
     // does not report the location of the last token accurately.
     SourceManager& SM = compiler.getSourceManager();
-    SourceLocation startLoc = compat::getBeginLoc(ifStmt);
-    SourceLocation endLoc = compat::getBeginLoc(ifStmt->getThen());
+    SourceLocation startLoc = ifStmt->getBeginLoc();
+    SourceLocation endLoc = ifStmt->getThen()->getBeginLoc();
     char const* p1 = SM.getCharacterData(startLoc);
     char const* p2 = SM.getCharacterData(endLoc);
 
diff --git a/compilerplugins/clang/colorcheck.cxx 
b/compilerplugins/clang/colorcheck.cxx
index 83f9a9688381..55f9034c675a 100644
--- a/compilerplugins/clang/colorcheck.cxx
+++ b/compilerplugins/clang/colorcheck.cxx
@@ -15,6 +15,8 @@
 #include <fstream>
 #include <set>
 
+#include "config_clang.h"
+
 #include "check.hxx"
 #include "plugin.hxx"
 
@@ -53,7 +55,7 @@ bool ColorCheck::VisitCXXConstructExpr(const 
CXXConstructExpr* constructExpr)
         return true;
 
     StringRef aFileName = getFilenameOfLocation(
-        
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(constructExpr)));
+        
compiler.getSourceManager().getSpellingLoc(constructExpr->getBeginLoc()));
     if (loplugin::isSamePathname(aFileName, SRCDIR "/include/tools/color.hxx"))
         return true;
 
@@ -71,7 +73,7 @@ bool ColorCheck::VisitCXXConstructExpr(const 
CXXConstructExpr* constructExpr)
         if (!arg0->isValueDependent())
         {
             llvm::Optional<llvm::APSInt> xVal
-                = compat::getIntegerConstantExpr(arg0, 
compiler.getASTContext());
+                = arg0->getIntegerConstantExpr(compiler.getASTContext());
             if (xVal && *xVal > 0xffffff)
                 report(DiagnosticsEngine::Warning,
                        "Rather use the ColorTransparency or ColorAlpha version 
of this constructor",
diff --git a/compilerplugins/clang/commaoperator.cxx 
b/compilerplugins/clang/commaoperator.cxx
index 3da4c18d1e10..3ba1c89c4be2 100644
--- a/compilerplugins/clang/commaoperator.cxx
+++ b/compilerplugins/clang/commaoperator.cxx
@@ -13,8 +13,6 @@
 #include <fstream>
 #include <set>
 
-#include "config_clang.h"
-
 #include "plugin.hxx"
 
 /**
@@ -84,10 +82,6 @@ public:
         return ret;
     }
 
-#if CLANG_VERSION < 110000
-    bool TraverseBinComma(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-#endif
-
     bool VisitBinaryOperator(const BinaryOperator* );
 
 private:
@@ -110,11 +104,11 @@ bool CommaOperator::VisitBinaryOperator(const 
BinaryOperator* binaryOp)
     // winsock2.h (TODO: improve heuristic of determining that the whole
     // binaryOp is part of a single macro body expansion):
     if (compiler.getSourceManager().isMacroBodyExpansion(
-            compat::getBeginLoc(binaryOp))
+            binaryOp->getBeginLoc())
         && compiler.getSourceManager().isMacroBodyExpansion(
             binaryOp->getOperatorLoc())
         && compiler.getSourceManager().isMacroBodyExpansion(
-            compat::getEndLoc(binaryOp))
+            binaryOp->getEndLoc())
         && ignoreLocation(
             compiler.getSourceManager().getSpellingLoc(
                 binaryOp->getOperatorLoc())))
diff --git a/compilerplugins/clang/comparisonwithconstant.cxx 
b/compilerplugins/clang/comparisonwithconstant.cxx
index b5dfe8cc6e7f..d796b7c3a3a1 100644
--- a/compilerplugins/clang/comparisonwithconstant.cxx
+++ b/compilerplugins/clang/comparisonwithconstant.cxx
@@ -13,8 +13,6 @@
 #include <fstream>
 #include <set>
 
-#include "config_clang.h"
-
 #include "compat.hxx"
 #include "plugin.hxx"
 
@@ -51,11 +49,6 @@ public:
         return ret;
     }
 
-#if CLANG_VERSION < 110000
-    bool TraverseBinEQ(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-    bool TraverseBinNE(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-#endif
-
     bool VisitBinaryOperator(const BinaryOperator *);
 private:
     bool rewrite(const BinaryOperator *);
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index bc1c5dfcd2ee..350263da6854 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -12,15 +12,11 @@
 #include <string>
 #include <utility>
 
-#include "clang/AST/Decl.h"
-#include "clang/AST/DeclCXX.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/ExprCXX.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/Specifiers.h"
 #include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Casting.h"
-#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FileSystem.h"
 
 #include "config_clang.h"
@@ -28,18 +24,6 @@
 // Compatibility wrapper to abstract over (trivial) changes in the Clang API:
 namespace compat {
 
-// Copies code from LLVM's include/llvm/Support/Casting.h:
-template<typename... X, typename Y> LLVM_NODISCARD inline bool 
isa_and_nonnull(Y const & Val) {
-#if CLANG_VERSION >= 90000
-    return llvm::isa_and_nonnull<X...>(Val);
-#else
-    if (!Val) {
-        return false;
-    }
-    return llvm::isa<X...>(Val);
-#endif
-}
-
 inline std::string toString(llvm::APSInt const & i, unsigned radix) {
 #if CLANG_VERSION >= 130000
     return llvm::toString(i, radix);
@@ -48,138 +32,17 @@ inline std::string toString(llvm::APSInt const & i, 
unsigned radix) {
 #endif
 }
 
-inline clang::SourceLocation getBeginLoc(clang::Decl const * decl) {
-#if CLANG_VERSION >= 80000
-    return decl->getBeginLoc();
-#else
-    return decl->getLocStart();
-#endif
-}
-
-inline clang::SourceLocation getEndLoc(clang::Decl const * decl) {
-#if CLANG_VERSION >= 80000
-    return decl->getEndLoc();
-#else
-    return decl->getLocEnd();
-#endif
-}
-
-inline clang::SourceLocation getBeginLoc(clang::DeclarationNameInfo const & 
info) {
-#if CLANG_VERSION >= 80000
-    return info.getBeginLoc();
-#else
-    return info.getLocStart();
-#endif
-}
-
-inline clang::SourceLocation getEndLoc(clang::DeclarationNameInfo const & 
info) {
-#if CLANG_VERSION >= 80000
-    return info.getEndLoc();
-#else
-    return info.getLocEnd();
-#endif
-}
-
-inline clang::SourceLocation getBeginLoc(clang::Stmt const * stmt) {
-#if CLANG_VERSION >= 80000
-    return stmt->getBeginLoc();
-#else
-    return stmt->getLocStart();
-#endif
-}
-
-inline clang::SourceLocation getEndLoc(clang::Stmt const * stmt) {
-#if CLANG_VERSION >= 80000
-    return stmt->getEndLoc();
-#else
-    return stmt->getLocEnd();
-#endif
-}
-
-inline clang::SourceLocation getBeginLoc(clang::CXXBaseSpecifier const * spec) 
{
-#if CLANG_VERSION >= 80000
-    return spec->getBeginLoc();
-#else
-    return spec->getLocStart();
-#endif
-}
-
-inline clang::SourceLocation getEndLoc(clang::CXXBaseSpecifier const * spec) {
-#if CLANG_VERSION >= 80000
-    return spec->getEndLoc();
-#else
-    return spec->getLocEnd();
-#endif
-}
-
 inline std::pair<clang::SourceLocation, clang::SourceLocation> 
getImmediateExpansionRange(
     clang::SourceManager const & SM, clang::SourceLocation Loc)
 {
-#if CLANG_VERSION >= 70000
     auto const csr = SM.getImmediateExpansionRange(Loc);
     if (csr.isCharRange()) { /*TODO*/ }
     return {csr.getBegin(), csr.getEnd()};
-#else
-    return SM.getImmediateExpansionRange(Loc);
-#endif
-}
-
-inline bool isPointWithin(
-    clang::SourceManager const & SM, clang::SourceLocation Location, 
clang::SourceLocation Start,
-    clang::SourceLocation End)
-{
-#if CLANG_VERSION >= 60000
-    return SM.isPointWithin(Location, Start, End);
-#else
-    return
-        Location == Start || Location == End
-        || (SM.isBeforeInTranslationUnit(Start, Location)
-            && SM.isBeforeInTranslationUnit(Location, End));
-#endif
-}
-
-inline clang::Expr const * IgnoreImplicit(clang::Expr const * expr) {
-#if CLANG_VERSION >= 80000
-    return expr->IgnoreImplicit();
-#else
-    using namespace clang;
-    // Copy from Clang's lib/AST/Stmt.cpp, including 
<https://reviews.llvm.org/D50666> "Fix
-    // Stmt::ignoreImplicit":
-    Stmt const *s = expr;
-
-    Stmt const *lasts = nullptr;
-
-    while (s != lasts) {
-        lasts = s;
-
-        if (auto *ewc = dyn_cast<ExprWithCleanups>(s))
-            s = ewc->getSubExpr();
-
-        if (auto *mte = dyn_cast<MaterializeTemporaryExpr>(s))
-            s = mte->GetTemporaryExpr();
-
-        if (auto *bte = dyn_cast<CXXBindTemporaryExpr>(s))
-            s = bte->getSubExpr();
-
-        if (auto *ice = dyn_cast<ImplicitCastExpr>(s))
-            s = ice->getSubExpr();
-    }
-
-    return static_cast<Expr const *>(s);
-#endif
 }
 
 /// Utility method
 inline clang::Expr const * IgnoreParenImplicit(clang::Expr const * expr) {
-    return 
compat::IgnoreImplicit(compat::IgnoreImplicit(expr)->IgnoreParens());
-}
-
-inline bool CPlusPlus17(clang::LangOptions const & opts) {
-#if CLANG_VERSION >= 60000
-    return opts.CPlusPlus17;
-#else
-    return opts.CPlusPlus1z;
-#endif
+    return expr->IgnoreImplicit()->IgnoreParens()->IgnoreImplicit();
 }
 
 #if CLANG_VERSION >= 130000
@@ -189,40 +52,13 @@ constexpr clang::ExprValueKind VK_PRValue = 
clang::VK_RValue;
 #endif
 
 inline bool EvaluateAsInt(clang::Expr const * expr, llvm::APSInt& intRes, 
const clang::ASTContext& ctx) {
-#if CLANG_VERSION >= 80000
     clang::Expr::EvalResult res;
     bool b = expr->EvaluateAsInt(res, ctx);
     if (b && res.Val.isInt())
         intRes = res.Val.getInt();
     return b;
-#else
-    return expr->EvaluateAsInt(intRes, ctx);
-#endif
 }
 
-inline llvm::Optional<llvm::APSInt> getIntegerConstantExpr(
-    clang::Expr const * expr, clang::ASTContext const & context)
-{
-#if CLANG_VERSION >= 120000
-    return expr->getIntegerConstantExpr(context);
-#else
-    llvm::APSInt res;
-    return expr->isIntegerConstantExpr(res, context) ? res : 
llvm::Optional<llvm::APSInt>();
-#endif
-}
-
-inline clang::Expr * getSubExpr(clang::MaterializeTemporaryExpr const * expr) {
-#if CLANG_VERSION >= 100000
-    return expr->getSubExpr();
-#else
-    return expr->GetTemporaryExpr();
-#endif
-}
-
-#if CLANG_VERSION < 80000
-inline clang::Expr const * getSubExprAsWritten(clang::CastExpr const * expr)
-{ return expr->getSubExprAsWritten(); }
-#else
 // Work around CastExpr::getSubExprAsWritten firing
 //
 //   include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, 
Y*>::ret_type llvm::cast(Y*)
@@ -251,7 +87,7 @@ namespace detail {
     // Skip through reference binding to temporary.
     if (clang::MaterializeTemporaryExpr *Materialize
                                   = 
clang::dyn_cast<clang::MaterializeTemporaryExpr>(expr))
-      expr = compat::getSubExpr(Materialize);
+      expr = Materialize->getSubExpr();
 
     // Skip any temporary bindings; they're implicit.
     if (clang::CXXBindTemporaryExpr *Binder = 
clang::dyn_cast<clang::CXXBindTemporaryExpr>(expr))
@@ -288,74 +124,6 @@ inline clang::Expr *getSubExprAsWritten(clang::CastExpr 
*This) {
 inline const clang::Expr *getSubExprAsWritten(const clang::CastExpr *This) {
   return getSubExprAsWritten(const_cast<clang::CastExpr *>(This));
 }
-#endif
-
-inline clang::QualType getObjectType(clang::CXXMemberCallExpr const * expr) {
-#if CLANG_VERSION >= 100000
-    return expr->getObjectType();
-#else
-    // 
<https://github.com/llvm/llvm-project/commit/88559637641e993895337e1047a0bd787fecc647>
-    // "[OpenCL] Improve destructor support in C++ for OpenCL":
-    clang::QualType Ty = expr->getImplicitObjectArgument()->getType();
-    if (Ty->isPointerType())
-        Ty = Ty->getPointeeType();
-    return Ty;
-#endif
-}
-
-inline bool isExplicitSpecified(clang::CXXConstructorDecl const * decl) {
-#if CLANG_VERSION >= 90000
-    return decl->getExplicitSpecifier().isExplicit();
-#else
-    return decl->isExplicitSpecified();
-#endif
-}
-
-inline bool isExplicitSpecified(clang::CXXConversionDecl const * decl) {
-#if CLANG_VERSION >= 90000
-    return decl->getExplicitSpecifier().isExplicit();
-#else
-    return decl->isExplicitSpecified();
-#endif
-}
-
-inline clang::QualType getDeclaredReturnType(clang::FunctionDecl const * decl) 
{
-#if CLANG_VERSION >= 80000
-    return decl->getDeclaredReturnType();
-#else
-    // 
<https://github.com/llvm/llvm-project/commit/4576a77b809649f5b8d0ff8c7a4be57eeee0ecf9>
-    // "PR33222: Require the declared return type not the actual return type 
to":
-    auto *TSI = decl->getTypeSourceInfo();
-    clang::QualType T = TSI ? TSI->getType() : decl->getType();
-    return T->castAs<clang::FunctionType>()->getReturnType();
-#endif
-}
-
-inline bool isComparisonOp(clang::CXXOperatorCallExpr const * callExpr)
-{
-#if CLANG_VERSION >= 110000
-    return callExpr->isComparisonOp();
-#else
-    using namespace clang;
-    auto op = callExpr->getOperator();
-    return op == OO_Less || op == OO_Greater || op == OO_LessEqual || op == 
OO_GreaterEqual
-           || op == OO_EqualEqual || op == OO_ExclaimEqual;
-#endif
-}
-
-inline bool isPtrMemOp(clang::BinaryOperatorKind op) {
-#if CLANG_VERSION >= 80000
-    return clang::BinaryOperator::isPtrMemOp(op);
-#else
-    return op == clang::BO_PtrMemD || op == clang::BO_PtrMemI;
-#endif
-}
-
-#if CLANG_VERSION >= 70000
-constexpr llvm::sys::fs::OpenFlags OF_None = llvm::sys::fs::OF_None;
-#else
-constexpr llvm::sys::fs::OpenFlags OF_None = llvm::sys::fs::F_None;
-#endif
 
 }
 
diff --git a/compilerplugins/clang/conditionalstring.cxx 
b/compilerplugins/clang/conditionalstring.cxx
index bf6c196846dc..cf858601ea0a 100644
--- a/compilerplugins/clang/conditionalstring.cxx
+++ b/compilerplugins/clang/conditionalstring.cxx
@@ -12,7 +12,6 @@
 #include <cassert>
 
 #include "check.hxx"
-#include "compat.hxx"
 #include "plugin.hxx"
 
 // Find uses of OUString in conditional expressions that could be rewritten as 
std::u16string_view,
@@ -32,15 +31,13 @@ Expr const* ignoreImplicit(Expr const* expr)
         {
             e = e1->getSubExprAsWritten();
         }
-#if CLANG_VERSION >= 80000
         else if (auto const e2 = dyn_cast<FullExpr>(e))
         {
             e = e2->getSubExpr();
         }
-#endif
         else if (auto const e3 = dyn_cast<MaterializeTemporaryExpr>(e))
         {
-            e = compat::getSubExpr(e3);
+            e = e3->getSubExpr();
         }
         else if (auto const e4 = dyn_cast<CXXBindTemporaryExpr>(e))
         {
@@ -398,8 +395,7 @@ private:
             {
                 e = e1->getSubExpr();
             }
-            if (auto const e1
-                = 
dyn_cast<CXXConstructExpr>(compat::IgnoreImplicit(e)->IgnoreParens()))
+            if (auto const e1 = 
dyn_cast<CXXConstructExpr>(e->IgnoreImplicit()->IgnoreParens()))
             {
                 if (e1->getNumArgs() != 0 //TODO
                     && 
isa<clang::StringLiteral>(e1->getArg(0)->IgnoreParenImpCasts()))
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();
 
diff --git a/compilerplugins/clang/constfields.cxx 
b/compilerplugins/clang/constfields.cxx
index c576d00bd9f5..692c84daeb8c 100644
--- a/compilerplugins/clang/constfields.cxx
+++ b/compilerplugins/clang/constfields.cxx
@@ -22,12 +22,9 @@
 #include "config_clang.h"
 
 #include "plugin.hxx"
-#include "compat.hxx"
 #include "check.hxx"
 
-#if CLANG_VERSION >= 110000
 #include "clang/AST/ParentMapContext.h"
-#endif
 
 /**
 Look for fields that are only assigned to in the constructor using field-init, 
and can therefore be const.
@@ -205,7 +202,7 @@ void ConstFields::run()
     else
     {
         for (const MyFieldInfo& s : cannotBeConstSet)
-            report(DiagnosticsEngine::Warning, "notconst %0", 
compat::getBeginLoc(s.parentRecord))
+            report(DiagnosticsEngine::Warning, "notconst %0", 
s.parentRecord->getBeginLoc())
                 << s.fieldName;
     }
 }
@@ -527,11 +524,11 @@ void ConstFields::check(const FieldDecl* fieldDecl, const 
Expr* memberExpr)
     if (bDump)
     {
         report(DiagnosticsEngine::Warning, "oh dear, what can the matter be? 
writtenTo=%0",
-               compat::getBeginLoc(memberExpr))
+               memberExpr->getBeginLoc())
             << bCannotBeConst << memberExpr->getSourceRange();
         if (parent)
         {
-            report(DiagnosticsEngine::Note, "parent over here", 
compat::getBeginLoc(parent))
+            report(DiagnosticsEngine::Note, "parent over here", 
parent->getBeginLoc())
                 << parent->getSourceRange();
             parent->dump();
         }
diff --git a/compilerplugins/clang/constfieldsrewrite.cxx 
b/compilerplugins/clang/constfieldsrewrite.cxx
index 52da9a153455..d72bb43aad7a 100644
--- a/compilerplugins/clang/constfieldsrewrite.cxx
+++ b/compilerplugins/clang/constfieldsrewrite.cxx
@@ -14,6 +14,7 @@
 #include <iostream>
 #include "plugin.hxx"
 #include "check.hxx"
+#include "config_clang.h"
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -154,7 +155,7 @@ bool ConstFieldsRewrite::VisitFieldDecl(const FieldDecl* 
fieldDecl)
     if (!success)
     {
         report(DiagnosticsEngine::Warning, "Could not mark field as const",
-               compat::getBeginLoc(fieldDecl))
+               fieldDecl->getBeginLoc())
             << fieldDecl->getSourceRange();
     }
     return true;
diff --git a/compilerplugins/clang/constmethod.cxx 
b/compilerplugins/clang/constmethod.cxx
index da5a64aea9b4..bd9c4db18d17 100644
--- a/compilerplugins/clang/constmethod.cxx
+++ b/compilerplugins/clang/constmethod.cxx
@@ -16,13 +16,10 @@
 #include "config_clang.h"
 
 #include "plugin.hxx"
-#include "compat.hxx"
 #include "check.hxx"
 #include "functionaddress.hxx"
 
-#if CLANG_VERSION >= 110000
 #include "clang/AST/ParentMapContext.h"
-#endif
 
 /**
    Find methods that can be declared const.
@@ -96,7 +93,7 @@ public:
                 || fqn == "OutputDevice::SelectClipRegion"
                 || fqn == "OutputDevice::BlendBitmap")
                 continue;
-            StringRef aFileName = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(canonicalDecl)));
+            StringRef aFileName = 
getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(canonicalDecl->getBeginLoc()));
             // leave the kit API alone
             if (loplugin::isSamePathname(aFileName, SRCDIR 
"/include/LibreOfficeKit/LibreOfficeKit.hxx"))
                 continue;
@@ -106,13 +103,13 @@ public:
             report(
                 DiagnosticsEngine::Warning,
                 "this method can be const",
-                compat::getBeginLoc(pMethodDecl))
+                pMethodDecl->getBeginLoc())
                 << pMethodDecl->getSourceRange();
             if (canonicalDecl->getLocation() != pMethodDecl->getLocation()) {
                 report(
                     DiagnosticsEngine::Note,
                     "canonical method declaration here",
-                    compat::getBeginLoc(canonicalDecl))
+                    canonicalDecl->getBeginLoc())
                     << canonicalDecl->getSourceRange();
             }
         }
@@ -223,7 +220,7 @@ bool ConstMethod::VisitCXXThisExpr( const CXXThisExpr* 
cxxThisExpr )
     if (ignoreLocation(cxxThisExpr))
         return true;
     // ignore stuff that forms part of the stable URE interface
-    if (isInUnoIncludeFile(compat::getBeginLoc(cxxThisExpr)))
+    if (isInUnoIncludeFile(cxxThisExpr->getBeginLoc()))
         return true;
     if (interestingMethodSet.find(currCXXMethodDecl) == 
interestingMethodSet.end())
         return true;
@@ -251,7 +248,7 @@ bool ConstMethod::checkIfCanBeConst(const Stmt* stmt, const 
CXXMethodDecl* cxxMe
             report(
                  DiagnosticsEngine::Warning,
                  "no parent?",
-                  compat::getBeginLoc(stmt))
+                  stmt->getBeginLoc())
                   << stmt->getSourceRange();
             return false;
         }
@@ -534,7 +531,7 @@ bool ConstMethod::checkIfCanBeConst(const Stmt* stmt, const 
CXXMethodDecl* cxxMe
     report(
          DiagnosticsEngine::Warning,
          "oh dear, what can the matter be?",
-          compat::getBeginLoc(parent))
+          parent->getBeginLoc())
           << parent->getSourceRange();
     return false;
 }
diff --git a/compilerplugins/clang/constparams.cxx 
b/compilerplugins/clang/constparams.cxx
index 950ae91e0b27..dac7322d0130 100644
--- a/compilerplugins/clang/constparams.cxx
+++ b/compilerplugins/clang/constparams.cxx
@@ -20,9 +20,7 @@
 #include "check.hxx"
 #include "functionaddress.hxx"
 
-#if CLANG_VERSION >= 110000
 #include "clang/AST/ParentMapContext.h"
-#endif
 
 /**
    Find pointer and reference params that can be declared const.
@@ -82,7 +80,7 @@ public:
             report(
                 DiagnosticsEngine::Warning,
                 "this parameter can be const %0",
-                compat::getBeginLoc(pParmVarDecl))
+                pParmVarDecl->getBeginLoc())
                 << fname << pParmVarDecl->getSourceRange();
             if (canonicalDecl->getLocation() != functionDecl->getLocation()) {
                 unsigned idx = pParmVarDecl->getFunctionScopeIndex();
@@ -90,7 +88,7 @@ public:
                 report(
                     DiagnosticsEngine::Note,
                     "canonical parameter declaration here",
-                    compat::getBeginLoc(pOther))
+                    pOther->getBeginLoc())
                     << pOther->getSourceRange();
             }
             //functionDecl->dump();
@@ -170,13 +168,13 @@ bool ConstParams::CheckTraverseFunctionDecl(FunctionDecl 
* functionDecl)
 
     // ignore the macros from include/tools/link.hxx
     auto canonicalDecl = functionDecl->getCanonicalDecl();
-    if 
(compiler.getSourceManager().isMacroBodyExpansion(compat::getBeginLoc(canonicalDecl))
-        || 
compiler.getSourceManager().isMacroArgExpansion(compat::getBeginLoc(canonicalDecl)))
 {
+    if 
(compiler.getSourceManager().isMacroBodyExpansion(canonicalDecl->getBeginLoc())
+        || 
compiler.getSourceManager().isMacroArgExpansion(canonicalDecl->getBeginLoc())) {
         StringRef name { Lexer::getImmediateMacroName(
-                compat::getBeginLoc(canonicalDecl), 
compiler.getSourceManager(), compiler.getLangOpts()) };
+                canonicalDecl->getBeginLoc(), compiler.getSourceManager(), 
compiler.getLangOpts()) };
         if (name.startswith("DECL_LINK") || 
name.startswith("DECL_STATIC_LINK"))
             return false;
-        auto loc2 = 
compat::getImmediateExpansionRange(compiler.getSourceManager(), 
compat::getBeginLoc(canonicalDecl)).first;
+        auto loc2 = 
compat::getImmediateExpansionRange(compiler.getSourceManager(), 
canonicalDecl->getBeginLoc()).first;
         if (compiler.getSourceManager().isMacroBodyExpansion(loc2))
         {
             StringRef name2 { Lexer::getImmediateMacroName(
@@ -329,7 +327,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const 
ParmVarDecl* parmVar
 //        report(
 //             DiagnosticsEngine::Warning,
 //             "no parent?",
-//              compat::getBeginLoc(stmt))
+//              stmt->getBeginLoc())
 //              << stmt->getSourceRange();
         return false;
     }
@@ -580,7 +578,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const 
ParmVarDecl* parmVar
     report(
          DiagnosticsEngine::Warning,
          "oh dear, what can the matter be?",
-          compat::getBeginLoc(parent))
+          parent->getBeginLoc())
           << parent->getSourceRange();
     return true;
 }
diff --git a/compilerplugins/clang/consttobool.cxx 
b/compilerplugins/clang/consttobool.cxx
index 4f4755cd8c3c..d20a0d5c9b48 100644
--- a/compilerplugins/clang/consttobool.cxx
+++ b/compilerplugins/clang/consttobool.cxx
@@ -15,8 +15,6 @@
 
 #include "clang/Basic/Builtins.h"
 
-#include "config_clang.h"
-
 #include "check.hxx"
 #include "plugin.hxx"
 
@@ -87,10 +85,6 @@ public:
         return ret;
     }
 
-#if CLANG_VERSION < 110000
-    bool TraverseUnaryLNot(UnaryOperator* expr) { return 
TraverseUnaryOperator(expr); }
-#endif
-
     bool PreTraverseBinaryOperator(BinaryOperator* expr)
     {
         if (expr->getOpcode() == BO_LAnd)
@@ -121,10 +115,6 @@ public:
         return ret;
     }
 
-#if CLANG_VERSION < 110000
-    bool TraverseBinLAnd(BinaryOperator* expr) { return 
TraverseBinaryOperator(expr); }
-#endif
-
     bool VisitImplicitCastExpr(ImplicitCastExpr const* expr)
     {
         if (ignoreLocation(expr))
diff --git a/compilerplugins/clang/constvars.cxx 
b/compilerplugins/clang/constvars.cxx
index e496d5f0ad15..2b06f54ea343 100644
--- a/compilerplugins/clang/constvars.cxx
+++ b/compilerplugins/clang/constvars.cxx
@@ -19,15 +19,10 @@
 #include <sys/file.h>
 #include <unistd.h>
 
-#include "config_clang.h"
-
 #include "plugin.hxx"
-#include "compat.hxx"
 #include "check.hxx"
 
-#if CLANG_VERSION >= 110000
 #include "clang/AST/ParentMapContext.h"
-#endif
 
 /**
 Look for static vars that are only assigned to once, and never written to, 
they can be const.
@@ -175,7 +170,7 @@ void ConstVars::run()
         // Implement a marker that disables this plugins warning at a specific 
site
         if (sourceString.contains("loplugin:constvars:ignore"))
             continue;
-        report(DiagnosticsEngine::Warning, "var can be const", 
compat::getBeginLoc(v));
+        report(DiagnosticsEngine::Warning, "var can be const", 
v->getBeginLoc());
     }
 }
 
@@ -213,7 +208,7 @@ bool ConstVars::VisitVarDecl(const VarDecl* varDecl)
 
 bool ConstVars::VisitCXXForRangeStmt(const CXXForRangeStmt* forStmt)
 {
-    if (compat::getBeginLoc(forStmt).isValid() && ignoreLocation(forStmt))
+    if (forStmt->getBeginLoc().isValid() && ignoreLocation(forStmt))
         return true;
     const VarDecl* varDecl = forStmt->getLoopVariable();
     if (!varDecl)
@@ -491,11 +486,11 @@ void ConstVars::check(const VarDecl* varDecl, const Expr* 
memberExpr)
     if (bDump)
     {
         report(DiagnosticsEngine::Warning, "oh dear, what can the matter be? 
writtenTo=%0",
-               compat::getBeginLoc(memberExpr))
+               memberExpr->getBeginLoc())
             << bCannotBeConst << memberExpr->getSourceRange();
         if (parent)
         {
-            report(DiagnosticsEngine::Note, "parent over here", 
compat::getBeginLoc(parent))
+            report(DiagnosticsEngine::Note, "parent over here", 
parent->getBeginLoc())
                 << parent->getSourceRange();
             parent->dump();
         }
diff --git a/compilerplugins/clang/convertlong.cxx 
b/compilerplugins/clang/convertlong.cxx
index 5d2ac82f5849..87b65a43f38b 100644
--- a/compilerplugins/clang/convertlong.cxx
+++ b/compilerplugins/clang/convertlong.cxx
@@ -13,6 +13,7 @@
 #include <iostream>
 #include <fstream>
 #include <set>
+#include "config_clang.h"
 #include "plugin.hxx"
 #include "check.hxx"
 
diff --git a/compilerplugins/clang/countusersofdefaultparams.cxx 
b/compilerplugins/clang/countusersofdefaultparams.cxx
index 073c58e104f7..c336509b3ef6 100644
--- a/compilerplugins/clang/countusersofdefaultparams.cxx
+++ b/compilerplugins/clang/countusersofdefaultparams.cxx
@@ -14,8 +14,9 @@
 
 #include "clang/AST/Attr.h"
 
+#include "config_clang.h"
+
 #include "plugin.hxx"
-#include "compat.hxx"
 
 /*
   Count call sites that are actually using the defaulted values on params on 
methods that declare such.
@@ -93,10 +94,6 @@ void CountUsersOfDefaultParams::niceName(const FunctionDecl* 
functionDecl, MyFun
 {
     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();
 
@@ -157,10 +154,6 @@ bool CountUsersOfDefaultParams::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();
     int n = functionDecl->getNumParams() - 1;
@@ -174,7 +167,7 @@ bool CountUsersOfDefaultParams::VisitCallExpr(const 
CallExpr * callExpr) {
     if ( n < (int)callExpr->getNumArgs() && 
callExpr->getArg(n)->isDefaultArgument()) {
         MyCallInfo callInfo;
         niceName(functionDecl, callInfo);
-        callInfo.sourceLocationOfCall = 
locationToString(compat::getBeginLoc(callExpr));
+        callInfo.sourceLocationOfCall = 
locationToString(callExpr->getBeginLoc());
         callSet.insert(callInfo);
     }
     return true;
@@ -188,10 +181,6 @@ bool 
CountUsersOfDefaultParams::VisitCXXConstructExpr(const CXXConstructExpr * c
     // work our way back to the root definition for template methods
     if (constructorDecl->getInstantiatedFromMemberFunction())
         constructorDecl = 
dyn_cast<CXXConstructorDecl>(constructorDecl->getInstantiatedFromMemberFunction());
-#if CLANG_VERSION < 90000
-    else if (constructorDecl->getClassScopeSpecializationPattern())
-        constructorDecl = 
dyn_cast<CXXConstructorDecl>(constructorDecl->getClassScopeSpecializationPattern());
-#endif
     else if (constructorDecl->getTemplateInstantiationPattern())
         constructorDecl = 
dyn_cast<CXXConstructorDecl>(constructorDecl->getTemplateInstantiationPattern());
     int n = constructorDecl->getNumParams() - 1;
@@ -205,7 +194,7 @@ bool CountUsersOfDefaultParams::VisitCXXConstructExpr(const 
CXXConstructExpr * c
     if ( n < (int)constructExpr->getNumArgs() && 
constructExpr->getArg(n)->isDefaultArgument()) {
         MyCallInfo callInfo;
         niceName(constructorDecl, callInfo);
-        callInfo.sourceLocationOfCall = 
locationToString(compat::getBeginLoc(constructExpr));
+        callInfo.sourceLocationOfCall = 
locationToString(constructExpr->getBeginLoc());
         callSet.insert(callInfo);
     }
     return true;
diff --git a/compilerplugins/clang/cow_wrapper.cxx 
b/compilerplugins/clang/cow_wrapper.cxx
index aed9d609d289..c98f70cbeb87 100644
--- a/compilerplugins/clang/cow_wrapper.cxx
+++ b/compilerplugins/clang/cow_wrapper.cxx
@@ -53,7 +53,7 @@ bool Cow_Wrapper::VisitCXXMemberCallExpr(const 
CXXMemberCallExpr* memberCallExpr
     if (!methodDecl || !methodDecl->isConst())
         return true;
 
-    auto expr = 
compat::IgnoreImplicit(memberCallExpr->getImplicitObjectArgument())->IgnoreParens();
+    auto expr = 
memberCallExpr->getImplicitObjectArgument()->IgnoreImplicit()->IgnoreParens();
     auto operatorCallExpr = dyn_cast<CXXOperatorCallExpr>(expr);
 
     if (operatorCallExpr && operatorCallExpr->getOperator() == OO_Arrow)
@@ -107,7 +107,7 @@ bool Cow_Wrapper::VisitCXXMemberCallExpr(const 
CXXMemberCallExpr* memberCallExpr
     report(DiagnosticsEngine::Warning,
            "calling const method on o3tl::cow_wrapper impl class via non-const 
pointer, rather use "
            "std::as_const to prevent triggering an unnecessary copy",
-           compat::getBeginLoc(memberCallExpr))
+           memberCallExpr->getBeginLoc())
         << memberCallExpr->getSourceRange();
     return true;
 }
diff --git a/compilerplugins/clang/cstylecast.cxx 
b/compilerplugins/clang/cstylecast.cxx
index 7fa2ce0ae1b0..35292ecd8fb6 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -240,7 +240,7 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * 
expr) {
     if( expr->getCastKind() == CK_ToVoid ) {
         return true;
     }
-    if (isSharedCAndCppCode(compat::getBeginLoc(expr))) {
+    if (isSharedCAndCppCode(expr->getBeginLoc())) {
         return true;
     }
     char const * perf = nullptr;
@@ -416,8 +416,8 @@ bool CStyleCast::rewriteArithmeticCast(CStyleCastExpr const 
* expr, char const *
         firstBegin = compiler.getSourceManager().getSpellingLoc(firstBegin);
         secondBegin = compiler.getSourceManager().getSpellingLoc(secondBegin);
     }
-    auto third = compat::getBeginLoc(sub);
-    auto fourth = compat::getEndLoc(sub);
+    auto third = sub->getBeginLoc();
+    auto fourth = sub->getEndLoc();
     bool macro = false;
     // Ensure that
     //
diff --git a/compilerplugins/clang/datamembershadow.cxx 
b/compilerplugins/clang/datamembershadow.cxx
index 7a5bf4bc3e87..93f65de66726 100644
--- a/compilerplugins/clang/datamembershadow.cxx
+++ b/compilerplugins/clang/datamembershadow.cxx
@@ -15,6 +15,7 @@
 #include <set>
 
 #include "plugin.hxx"
+#include "config_clang.h"
 #include "clang/AST/CXXInheritance.h"
 
 /**
@@ -47,7 +48,7 @@ bool DataMemberShadow::VisitFieldDecl(FieldDecl const * 
fieldDecl)
         return true;
     }
     StringRef aFileName = getFilenameOfLocation(
-        
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(fieldDecl)));
+        compiler.getSourceManager().getSpellingLoc(fieldDecl->getBeginLoc()));
 
     // FIXME complex stuff to fix later
 
@@ -99,13 +100,13 @@ bool DataMemberShadow::VisitFieldDecl(FieldDecl const * 
fieldDecl)
             sPath += baseCXXRecordDecl->getNameAsString();
             report(DiagnosticsEngine::Warning,
                     "data member %0 is shadowing member in superclass, through 
inheritance path %1",
-                    compat::getBeginLoc(fieldDecl))
+                    fieldDecl->getBeginLoc())
                 << fieldDecl->getName()
                 << sPath
                 << fieldDecl->getSourceRange();
             report(DiagnosticsEngine::Note,
                     "superclass member here",
-                    compat::getBeginLoc(baseFieldDecl))
+                    baseFieldDecl->getBeginLoc())
                 << baseFieldDecl->getSourceRange();
         }
         return false;
diff --git a/compilerplugins/clang/dbgunhandledexception.cxx 
b/compilerplugins/clang/dbgunhandledexception.cxx
index d1406c18a9dd..e6c1f157cc9d 100644
--- a/compilerplugins/clang/dbgunhandledexception.cxx
+++ b/compilerplugins/clang/dbgunhandledexception.cxx
@@ -88,7 +88,7 @@ bool DbgUnhandledException::VisitCallExpr(const CallExpr* 
call)
     if (currCatchStmt.empty())
     {
         report(DiagnosticsEngine::Warning, "DBG_UNHANDLED_EXCEPTION outside 
catch block",
-               compat::getBeginLoc(call));
+               call->getBeginLoc());
         return true;
     }
     auto catchBlock = 
dyn_cast<CompoundStmt>(currCatchStmt.top()->getHandlerBlock());
@@ -96,14 +96,14 @@ bool DbgUnhandledException::VisitCallExpr(const CallExpr* 
call)
     {
         report(DiagnosticsEngine::Warning,
                "something wrong with DBG_UNHANDLED_EXCEPTION, no 
CompoundStmt?",
-               compat::getBeginLoc(call));
+               call->getBeginLoc());
         return true;
     }
     if (catchBlock->size() < 1)
     {
         report(DiagnosticsEngine::Warning,
                "something wrong with DBG_UNHANDLED_EXCEPTION, CompoundStmt 
size == 0?",
-               compat::getBeginLoc(call));
+               call->getBeginLoc());
         return true;
     }
 
@@ -114,7 +114,7 @@ bool DbgUnhandledException::VisitCallExpr(const CallExpr* 
call)
     {
         report(DiagnosticsEngine::Warning,
                "DBG_UNHANDLED_EXCEPTION must be first statement in catch 
block",
-               compat::getBeginLoc(call));
+               call->getBeginLoc());
     }
     return true;
 }
diff --git a/compilerplugins/clang/derefnullptr.cxx 
b/compilerplugins/clang/derefnullptr.cxx
index b1c9d6da6747..35c4c7adcf6c 100644
--- a/compilerplugins/clang/derefnullptr.cxx
+++ b/compilerplugins/clang/derefnullptr.cxx
@@ -37,7 +37,7 @@ bool DerefNullPtr::VisitUnaryOperator(UnaryOperator const * 
op) {
     {
         report(
             DiagnosticsEngine::Warning, "null pointer dereference",
-            compat::getBeginLoc(op))
+            op->getBeginLoc())
             << op->getSourceRange();
     }
     return true;
diff --git a/compilerplugins/clang/dodgyswitch.cxx 
b/compilerplugins/clang/dodgyswitch.cxx
index d0674b3632b0..43958f1364ad 100644
--- a/compilerplugins/clang/dodgyswitch.cxx
+++ b/compilerplugins/clang/dodgyswitch.cxx
@@ -41,7 +41,7 @@ bool DodgySwitch::VisitDefaultStmt(DefaultStmt const * 
defaultStmt)
     if (!IsParentSwitch(defaultStmt))
         report(
             DiagnosticsEngine::Warning, "default statement not directly under 
switch",
-            compat::getBeginLoc(defaultStmt))
+            defaultStmt->getBeginLoc())
           << defaultStmt->getSourceRange();
     return true;
 }
@@ -55,7 +55,7 @@ bool DodgySwitch::VisitCaseStmt(CaseStmt const * caseStmt)
         //parentStmt(parentStmt(caseStmt))->dump();
         report(
             DiagnosticsEngine::Warning, "case statement not directly under 
switch",
-            compat::getBeginLoc(caseStmt))
+            caseStmt->getBeginLoc())
           << caseStmt->getSourceRange();
     }
     return true;
diff --git a/compilerplugins/clang/doubleconvert.cxx 
b/compilerplugins/clang/doubleconvert.cxx
index 6a08ae376a95..6f9cc88df742 100644
--- a/compilerplugins/clang/doubleconvert.cxx
+++ b/compilerplugins/clang/doubleconvert.cxx
@@ -10,7 +10,6 @@
 #ifndef LO_CLANG_SHARED_PLUGINS
 
 #include "check.hxx"
-#include "compat.hxx"
 #include "plugin.hxx"
 
 /**
@@ -58,7 +57,7 @@ bool DoubleConvert::VisitCXXConstructExpr(CXXConstructExpr 
const* cxxConstruct)
         = 
dyn_cast<CXXMemberCallExpr>(cxxConstruct->getArg(0)->IgnoreParenCasts());
     if (!cxxMemberCallExpr)
         return true;
-    if 
(!compat::isa_and_nonnull<CXXConversionDecl>(cxxMemberCallExpr->getMethodDecl()))
+    if 
(!isa_and_nonnull<CXXConversionDecl>(cxxMemberCallExpr->getMethodDecl()))
         return true;
     if (cxxConstruct->getType().getCanonicalType().getTypePtr()
         != cxxMemberCallExpr->getImplicitObjectArgument()
diff --git a/compilerplugins/clang/dyncastvisibility.cxx 
b/compilerplugins/clang/dyncastvisibility.cxx
index 3c54f7cf8929..7259374c98ea 100644
--- a/compilerplugins/clang/dyncastvisibility.cxx
+++ b/compilerplugins/clang/dyncastvisibility.cxx
@@ -15,6 +15,8 @@
 #include <set>
 #include <string>
 
+#include "config_clang.h"
+
 #include "plugin.hxx"
 
 namespace {
diff --git a/compilerplugins/clang/elidestringvar.cxx 
b/compilerplugins/clang/elidestringvar.cxx
index 412fa8cb09db..89e740d21904 100644
--- a/compilerplugins/clang/elidestringvar.cxx
+++ b/compilerplugins/clang/elidestringvar.cxx
@@ -14,7 +14,6 @@
 #include <map>
 
 #include "check.hxx"
-#include "compat.hxx"
 #include "plugin.hxx"
 
 // Find cases where a variable of a OString/OUString type is initialized
@@ -62,8 +61,8 @@ public:
             {
                 continue;
             }
-            if (containsPreprocessingConditionalInclusion(SourceRange(
-                    compat::getBeginLoc(var.first), 
compat::getEndLoc(*var.second.singleUse))))
+            if (containsPreprocessingConditionalInclusion(
+                    SourceRange(var.first->getBeginLoc(), 
(*var.second.singleUse)->getEndLoc())))
             {
                 // This is not perfect, as additional uses can be hidden in 
conditional blocks that
                 // only start after the (would-be) single use (as was the case 
in
diff --git a/compilerplugins/clang/empty.cxx b/compilerplugins/clang/empty.cxx
index c3cc86520f47..d5129d29dd3c 100644
--- a/compilerplugins/clang/empty.cxx
+++ b/compilerplugins/clang/empty.cxx
@@ -12,7 +12,6 @@
 #include <cassert>
 
 #include "check.hxx"
-#include "compat.hxx"
 #include "plugin.hxx"
 
 // Warn about checks whether a container is empty done via an (expensive) call 
to obtain the
@@ -77,7 +76,7 @@ private:
         {
             return;
         }
-        auto const val = compat::getIntegerConstantExpr(rhs, 
compiler.getASTContext());
+        auto const val = rhs->getIntegerConstantExpr(compiler.getASTContext());
         if (!val)
         {
             return;
diff --git a/compilerplugins/clang/emptyif.cxx 
b/compilerplugins/clang/emptyif.cxx
index ef7eac50d048..5412188f8d52 100644
--- a/compilerplugins/clang/emptyif.cxx
+++ b/compilerplugins/clang/emptyif.cxx
@@ -71,15 +71,14 @@ bool EmptyIf::VisitIfStmt(IfStmt const* ifStmt)
 
     if (ifStmt->getElse() && empty(ifStmt->getElse()) && 
!ContainsComment(ifStmt->getElse()))
     {
-        report(DiagnosticsEngine::Warning, "empty else body",
-               compat::getBeginLoc(ifStmt->getElse()))
+        report(DiagnosticsEngine::Warning, "empty else body", 
ifStmt->getElse()->getBeginLoc())
             << ifStmt->getElse()->getSourceRange();
         return true;
     }
 
     if (!ifStmt->getElse() && empty(ifStmt->getThen()) && 
!ContainsComment(ifStmt->getThen()))
     {
-        report(DiagnosticsEngine::Warning, "empty if body", 
compat::getBeginLoc(ifStmt))
+        report(DiagnosticsEngine::Warning, "empty if body", 
ifStmt->getBeginLoc())
             << ifStmt->getSourceRange();
     }
 
diff --git a/compilerplugins/clang/expandablemethods.cxx 
b/compilerplugins/clang/expandablemethods.cxx
index d40dadd90247..5b09345d414c 100644
--- a/compilerplugins/clang/expandablemethods.cxx
+++ b/compilerplugins/clang/expandablemethods.cxx
@@ -17,8 +17,9 @@
 
 #include "clang/AST/Attr.h"
 
+#include "config_clang.h"
+
 #include "plugin.hxx"
-#include "compat.hxx"
 
 /**
  Find methods that are only called from inside their own class, and are only 
called from one spot.
@@ -114,10 +115,6 @@ MyFuncInfo ExpandableMethods::niceName(const FunctionDecl* 
functionDecl)
 {
     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();
 
@@ -270,7 +267,7 @@ void ExpandableMethods::functionTouchedFromExpr( const 
FunctionDecl* calleeFunct
         return;
     }
 
-    calledFromSet.emplace(toString(compat::getBeginLoc(expr)), 
niceName(canonicalFunctionDecl));
+    calledFromSet.emplace(toString(expr->getBeginLoc()), 
niceName(canonicalFunctionDecl));
 
     if (const UnaryOperator* unaryOp = 
dyn_cast_or_null<UnaryOperator>(getParentStmt(expr))) {
         if (unaryOp->getOpcode() == UO_AddrOf) {
diff --git a/compilerplugins/clang/expressionalwayszero.cxx 
b/compilerplugins/clang/expressionalwayszero.cxx
index b5650aa076a2..f741d30c426b 100644
--- a/compilerplugins/clang/expressionalwayszero.cxx
+++ b/compilerplugins/clang/expressionalwayszero.cxx
@@ -72,7 +72,7 @@ bool ExpressionAlwaysZero::VisitBinaryOperator(BinaryOperator 
const* binaryOpera
 {
     if (ignoreLocation(binaryOperator))
         return true;
-    if (compat::getBeginLoc(binaryOperator).isMacroID())
+    if (binaryOperator->getBeginLoc().isMacroID())
         return true;
 
     auto op = binaryOperator->getOpcode();
@@ -90,7 +90,7 @@ bool ExpressionAlwaysZero::VisitBinaryOperator(BinaryOperator 
const* binaryOpera
     else
         return true;
     report(DiagnosticsEngine::Warning, "expression always evaluates to zero, 
lhs=%0 rhs=%1",
-           compat::getBeginLoc(binaryOperator))
+           binaryOperator->getBeginLoc())
         << (lhsValue ? compat::toString(*lhsValue, 10) : "unknown")
         << (rhsValue ? compat::toString(*rhsValue, 10) : "unknown")
         << binaryOperator->getSourceRange();
@@ -101,7 +101,7 @@ bool 
ExpressionAlwaysZero::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const* c
 {
     if (ignoreLocation(cxxOperatorCallExpr))
         return true;
-    if (compat::getBeginLoc(cxxOperatorCallExpr).isMacroID())
+    if (cxxOperatorCallExpr->getBeginLoc().isMacroID())
         return true;
 
     auto op = cxxOperatorCallExpr->getOperator();
@@ -121,7 +121,7 @@ bool 
ExpressionAlwaysZero::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const* c
     else
         return true;
     report(DiagnosticsEngine::Warning, "expression always evaluates to zero, 
lhs=%0 rhs=%1",
-           compat::getBeginLoc(cxxOperatorCallExpr))
+           cxxOperatorCallExpr->getBeginLoc())
         << (lhsValue ? compat::toString(*lhsValue, 10) : "unknown")
         << (rhsValue ? compat::toString(*rhsValue, 10) : "unknown")
         << cxxOperatorCallExpr->getSourceRange();
diff --git a/compilerplugins/clang/externandnotdefined.cxx 
b/compilerplugins/clang/externandnotdefined.cxx
index c40837fa961a..676f666ba621 100644
--- a/compilerplugins/clang/externandnotdefined.cxx
+++ b/compilerplugins/clang/externandnotdefined.cxx
@@ -11,6 +11,8 @@
 
 #include <string>
 
+#include "config_clang.h"
+
 #include "plugin.hxx"
 
 // Having an extern prototype for a method in a module and not actually 
declaring that method is dodgy.
diff --git a/compilerplugins/clang/faileddyncast.cxx 
b/compilerplugins/clang/faileddyncast.cxx
index 03d4feb48550..078d5c884b27 100644
--- a/compilerplugins/clang/faileddyncast.cxx
+++ b/compilerplugins/clang/faileddyncast.cxx
@@ -122,7 +122,7 @@ bool 
FailedDynCast::VisitCXXDynamicCastExpr(CXXDynamicCastExpr const * expr) {
     if (isAlwaysNull(expr)) {
         report(
             DiagnosticsEngine::Warning,
-            "dynamic_cast from %0 to %1 always fails", 
compat::getBeginLoc(expr))
+            "dynamic_cast from %0 to %1 always fails", expr->getBeginLoc())
             << expr->getSubExpr()->getType() << expr->getType()
             << expr->getSourceRange();
     }
diff --git a/compilerplugins/clang/fakebool.cxx 
b/compilerplugins/clang/fakebool.cxx
index 277dd915bf0d..3d5120153d0b 100644
--- a/compilerplugins/clang/fakebool.cxx
+++ b/compilerplugins/clang/fakebool.cxx
@@ -16,8 +16,9 @@
 #include "clang/AST/Attr.h"
 #include "clang/Basic/Builtins.h"
 
+#include "config_clang.h"
+
 #include "check.hxx"
-#include "compat.hxx"
 #include "functionaddress.hxx"
 #include "plugin.hxx"
 
@@ -237,7 +238,7 @@ void FakeBool::run() {
         TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
         for (auto const & dcl: varDecls_) {
             auto const decl = dcl.first; auto const fbk = dcl.second;
-            SourceLocation loc { compat::getBeginLoc(decl) };
+            SourceLocation loc { decl->getBeginLoc() };
             TypeSourceInfo * tsi = decl->getTypeSourceInfo();
             if (tsi != nullptr) {
                 SourceLocation l {
@@ -279,7 +280,7 @@ void FakeBool::run() {
         }
         for (auto const & dcl: fieldDecls_) {
             auto const decl = dcl.first; auto const fbk = dcl.second;
-            SourceLocation loc { compat::getBeginLoc(decl) };
+            SourceLocation loc { decl->getBeginLoc() };
             TypeSourceInfo * tsi = decl->getTypeSourceInfo();
             if (tsi != nullptr) {
                 SourceLocation l {
@@ -325,7 +326,7 @@ void FakeBool::run() {
             if (ignoredFns.find(f) != ignoredFns.end()) {
                 continue;
             }
-            SourceLocation loc { compat::getBeginLoc(decl) };
+            SourceLocation loc { decl->getBeginLoc() };
             TypeSourceInfo * tsi = decl->getTypeSourceInfo();
             if (tsi != nullptr) {
                 SourceLocation l {
@@ -399,7 +400,7 @@ void FakeBool::run() {
             if (ignoredFns.find(f) != ignoredFns.end()) {
                 continue;
             }
-            SourceLocation loc { compat::getBeginLoc(decl) };
+            SourceLocation loc { decl->getBeginLoc() };
             SourceLocation l { compiler.getSourceManager().getExpansionLoc(
                 loc) };
             SourceLocation end { compiler.getSourceManager().getExpansionLoc(
@@ -536,7 +537,7 @@ bool FakeBool::VisitCStyleCastExpr(CStyleCastExpr * expr) {
     }
     auto const k = isFakeBool(expr->getType());
     if (k != FBK_No) {
-        SourceLocation loc { compat::getBeginLoc(expr) };
+        SourceLocation loc { expr->getBeginLoc() };
         while (compiler.getSourceManager().isMacroArgExpansion(loc)) {
             loc = compiler.getSourceManager().getImmediateMacroCallerLoc(loc);
         }
@@ -549,7 +550,7 @@ bool FakeBool::VisitCStyleCastExpr(CStyleCastExpr * expr) {
                 if (!isSharedCAndCppCode(callLoc)) {
                     SourceLocation argLoc;
                     if (compiler.getSourceManager().isMacroArgExpansion(
-                            compat::getBeginLoc(expr), &argLoc)
+                            expr->getBeginLoc(), &argLoc)
                         //TODO: check it's the complete (first) arg to the 
macro
                         && (Lexer::getImmediateMacroName(
                                 argLoc, compiler.getSourceManager(),
@@ -591,7 +592,7 @@ bool FakeBool::VisitCStyleCastExpr(CStyleCastExpr * expr) {
         report(
             DiagnosticsEngine::Warning,
             "CStyleCastExpr, suspicious cast from %0 to %1",
-            compat::getBeginLoc(expr))
+            expr->getBeginLoc())
             << expr->getSubExpr()->IgnoreParenImpCasts()->getType()
             << expr->getType() << expr->getSourceRange();
     }
@@ -608,14 +609,14 @@ bool FakeBool::VisitCXXStaticCastExpr(CXXStaticCastExpr * 
expr) {
     }
     if (k == FBK_sal_Bool
         && isInSpecialMainFile(
-            
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(expr))))
+            compiler.getSourceManager().getSpellingLoc(expr->getBeginLoc())))
     {
         return true;
     }
     report(
         DiagnosticsEngine::Warning,
         "CXXStaticCastExpr, suspicious cast from %0 to %1",
-        compat::getBeginLoc(expr))
+        expr->getBeginLoc())
         << expr->getSubExpr()->IgnoreParenImpCasts()->getType()
         << expr->getType() << expr->getSourceRange();
     return true;
@@ -629,7 +630,7 @@ bool 
FakeBool::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr * expr) {
         report(
             DiagnosticsEngine::Warning,
             "CXXFunctionalCastExpr, suspicious cast from %0 to %1",
-            compat::getBeginLoc(expr))
+            expr->getBeginLoc())
             << expr->getSubExpr()->IgnoreParenImpCasts()->getType()
             << expr->getType() << expr->getSourceRange();
     }
@@ -644,7 +645,7 @@ bool FakeBool::VisitImplicitCastExpr(ImplicitCastExpr * 
expr) {
     if (isFakeBool(expr->getType()) == FBK_No) {
         return true;
     }
-    auto l = compat::getBeginLoc(expr);
+    auto l = expr->getBeginLoc();
     while (compiler.getSourceManager().isMacroArgExpansion(l)) {
         l = compiler.getSourceManager().getImmediateMacroCallerLoc(l);
     }
@@ -675,7 +676,7 @@ bool FakeBool::VisitImplicitCastExpr(ImplicitCastExpr * 
expr) {
     }
     report(
         DiagnosticsEngine::Warning, "conversion from %0 to %1",
-        compat::getBeginLoc(expr))
+        expr->getBeginLoc())
         << t << expr->getType() << expr->getSourceRange();
     return true;
 }
@@ -776,7 +777,7 @@ bool FakeBool::VisitVarDecl(VarDecl const * decl) {
     if (k == FBK_No) {
         return true;
     }
-    auto const loc = compat::getBeginLoc(decl);
+    auto const loc = decl->getBeginLoc();
     if (k == FBK_sal_Bool
         && isInSpecialMainFile(
             compiler.getSourceManager().getSpellingLoc(loc)))
@@ -816,7 +817,7 @@ bool FakeBool::VisitFieldDecl(FieldDecl const * decl) {
     }
     if (k == FBK_sal_Bool
         && isInSpecialMainFile(
-            
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(decl))))
+            compiler.getSourceManager().getSpellingLoc(decl->getBeginLoc())))
     {
         return true;
     }
@@ -866,11 +867,11 @@ bool FakeBool::VisitValueDecl(ValueDecl const * decl) {
         return true;
     }
     auto const k = isFakeBool(decl->getType());
-    if (k != FBK_No && !rewrite(compat::getBeginLoc(decl), k)) {
+    if (k != FBK_No && !rewrite(decl->getBeginLoc(), k)) {
         report(
             DiagnosticsEngine::Warning,
             "ValueDecl, use \"bool\" instead of %0",
-            compat::getBeginLoc(decl))
+            decl->getBeginLoc())
             << decl->getType() << decl->getSourceRange();
     }
     return true;
diff --git a/compilerplugins/clang/finalclasses.cxx 
b/compilerplugins/clang/finalclasses.cxx
index 447e3406e5e6..e061bb7c5ef2 100644
--- a/compilerplugins/clang/finalclasses.cxx
+++ b/compilerplugins/clang/finalclasses.cxx
@@ -11,6 +11,7 @@
 #include <set>
 #include <string>
 #include <iostream>
+#include "config_clang.h"
 #include "plugin.hxx"
 #include <fstream>
 
@@ -131,7 +132,7 @@ bool FinalClasses::VisitCXXRecordDecl(const CXXRecordDecl* 
decl)
     if (ignoreClass(s))
         return true;
 
-    SourceLocation spellingLocation = 
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(decl));
+    SourceLocation spellingLocation = 
compiler.getSourceManager().getSpellingLoc(decl->getBeginLoc());
     auto const filename = getFilenameOfLocation(spellingLocation);
     auto sourceLocation = filename.substr(strlen(SRCDIR)).str() + ":"
         + 
std::to_string(compiler.getSourceManager().getSpellingLineNumber(spellingLocation));
diff --git a/compilerplugins/clang/flatten.cxx 
b/compilerplugins/clang/flatten.cxx
index a615b8366b63..8d7eac9d92b0 100644
--- a/compilerplugins/clang/flatten.cxx
+++ b/compilerplugins/clang/flatten.cxx
@@ -204,7 +204,7 @@ bool Flatten::VisitIfStmt(IfStmt const * ifStmt)
             report(
                 DiagnosticsEngine::Warning,
                 "large if statement at end of function, rather invert the 
condition and exit early, and flatten the function",
-                compat::getBeginLoc(ifStmt))
+                ifStmt->getBeginLoc())
               << ifStmt->getSourceRange();
         }
         return true;
@@ -238,12 +238,12 @@ bool Flatten::VisitIfStmt(IfStmt const * ifStmt)
             report(
                 DiagnosticsEngine::Warning,
                 "unconditional throw in else branch, rather invert the 
condition, throw early, and flatten the normal case",
-                compat::getBeginLoc(elseThrowExpr))
+                elseThrowExpr->getBeginLoc())
                 << elseThrowExpr->getSourceRange();
             report(
                 DiagnosticsEngine::Note,
                 "if condition here",
-                compat::getBeginLoc(ifStmt))
+                ifStmt->getBeginLoc())
                 << ifStmt->getSourceRange();
         }
     }
@@ -260,7 +260,7 @@ bool Flatten::VisitIfStmt(IfStmt const * ifStmt)
             report(
                 DiagnosticsEngine::Warning,
                 "unconditional throw in then branch, just flatten the else",
-                compat::getBeginLoc(thenThrowExpr))
+                thenThrowExpr->getBeginLoc())
                 << thenThrowExpr->getSourceRange();
         }
     }
diff --git a/compilerplugins/clang/fragiledestructor.cxx 
b/compilerplugins/clang/fragiledestructor.cxx
index c9f8568fdafd..f8ec76a561f8 100644
--- a/compilerplugins/clang/fragiledestructor.cxx
+++ b/compilerplugins/clang/fragiledestructor.cxx
@@ -12,7 +12,7 @@
 #include <iostream>
 
 #include "plugin.hxx"
-#include "compat.hxx"
+#include "config_clang.h"
 #include "clang/AST/CXXInheritance.h"
 
 
@@ -113,8 +113,8 @@ bool FragileDestructor::VisitCXXMemberCallExpr(const 
CXXMemberCallExpr* callExpr
         return true;
 
     // if we see an explicit call to its own method, that's OK
-    auto s1 = 
compiler.getSourceManager().getCharacterData(compat::getBeginLoc(callExpr));
-    auto s2 = 
compiler.getSourceManager().getCharacterData(compat::getEndLoc(callExpr));
+    auto s1 = 
compiler.getSourceManager().getCharacterData(callExpr->getBeginLoc());
+    auto s2 = 
compiler.getSourceManager().getCharacterData(callExpr->getEndLoc());
     std::string tok(s1, s2-s1);
     if (tok.find("::") != std::string::npos)
         return true;
@@ -127,12 +127,12 @@ bool FragileDestructor::VisitCXXMemberCallExpr(const 
CXXMemberCallExpr* callExpr
     report(
         DiagnosticsEngine::Warning,
         "calling virtual method from destructor, either make the virtual 
method final, or make this class final",
-        compat::getBeginLoc(callExpr))
+        callExpr->getBeginLoc())
       << callExpr->getSourceRange();
     report(
         DiagnosticsEngine::Note,
         "callee method here",
-        compat::getBeginLoc(methodDecl))
+        methodDecl->getBeginLoc())
       << methodDecl->getSourceRange();
     return true;
 }
diff --git a/compilerplugins/clang/getstr.cxx b/compilerplugins/clang/getstr.cxx
index aba53bd6e2e5..671699e73551 100644
--- a/compilerplugins/clang/getstr.cxx
+++ b/compilerplugins/clang/getstr.cxx
@@ -13,7 +13,6 @@
 #include <stack>
 
 #include "check.hxx"
-#include "compat.hxx"
 #include "plugin.hxx"
 
 // Find matches of
@@ -89,7 +88,7 @@ public:
                 castToVoid = true;
             }
         }
-        auto const t = compat::getObjectType(e);
+        auto const t = e->getObjectType();
         auto const tc = loplugin::TypeCheck(t);
         if (!(tc.Class("OString").Namespace("rtl").GlobalNamespace()
               || tc.Class("OUString").Namespace("rtl").GlobalNamespace()
diff --git a/compilerplugins/clang/implicitboolconversion.cxx 
b/compilerplugins/clang/implicitboolconversion.cxx
index bc0b74932b71..e61f4a14cf0f 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -17,8 +17,6 @@
 
 #include "clang/Basic/Builtins.h"
 
-#include "config_clang.h"
-
 #include "check.hxx"
 #include "compat.hxx"
 #include "plugin.hxx"
@@ -32,7 +30,7 @@ Expr const * ignoreParenAndTemporaryMaterialization(Expr 
const * expr) {
         if (e == nullptr) {
             return expr;
         }
-        expr = compat::getSubExpr(e);
+        expr = e->getSubExpr();
     }
 }
 
@@ -253,27 +251,8 @@ public:
 
     bool TraverseBinaryOperator(BinaryOperator * expr);
 
-#if CLANG_VERSION < 110000
-    bool TraverseBinLT(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-    bool TraverseBinLE(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-    bool TraverseBinGT(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-    bool TraverseBinGE(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-    bool TraverseBinEQ(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-    bool TraverseBinNE(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-    bool TraverseBinAssign(BinaryOperator * expr) { return 
TraverseBinaryOperator(expr); }
-#endif
-
     bool TraverseCompoundAssignOperator(CompoundAssignOperator * expr);
 
-#if CLANG_VERSION < 110000
-    bool TraverseBinAndAssign(CompoundAssignOperator * expr)
-    { return TraverseCompoundAssignOperator(expr); }
-    bool TraverseBinOrAssign(CompoundAssignOperator * expr)
-    { return TraverseCompoundAssignOperator(expr); }
-    bool TraverseBinXorAssign(CompoundAssignOperator * expr)
-    { return TraverseCompoundAssignOperator(expr); }
-#endif
-
     bool TraverseInitListExpr(InitListExpr * expr);
 
     bool TraverseReturnStmt(ReturnStmt * stmt);
@@ -613,7 +592,7 @@ bool 
ImplicitBoolConversion::TraverseCompoundAssignOperator(CompoundAssignOperat
             {
                 report(
                     DiagnosticsEngine::Warning, "mix of %0 and %1 in operator 
%2",
-                    compat::getBeginLoc(expr->getRHS()))
+                    expr->getRHS()->getBeginLoc())
                     << expr->getLHS()->getType()
                     << expr->getRHS()->IgnoreParenImpCasts()->getType()
                     << expr->getOpcodeStr()
@@ -729,7 +708,7 @@ bool ImplicitBoolConversion::VisitImplicitCastExpr(
                 DiagnosticsEngine::Warning,
                 ("explicit conversion (%0) from %1 to %2 implicitly cast back"
                  " to %3"),
-                compat::getBeginLoc(expr))
+                expr->getBeginLoc())
                 << sub->getCastKindName() << subsub->getType() << 
sub->getType()
                 << expr->getType() << expr->getSourceRange();
             return true;
@@ -746,7 +725,7 @@ bool ImplicitBoolConversion::VisitImplicitCastExpr(
             report(
                 DiagnosticsEngine::Warning,
                 "implicit conversion (%0) of call argument from %1 to %2",
-                compat::getBeginLoc(expr))
+                expr->getBeginLoc())
                 << expr->getCastKindName() << expr->getSubExpr()->getType()
                 << expr->getType() << expr->getSourceRange();
             return true;
@@ -761,7 +740,7 @@ bool ImplicitBoolConversion::VisitMaterializeTemporaryExpr(
     if (ignoreLocation(expr)) {
         return true;
     }
-    if (auto const sub = dyn_cast<ExplicitCastExpr>(compat::getSubExpr(expr))) 
{
+    if (auto const sub = dyn_cast<ExplicitCastExpr>(expr->getSubExpr())) {
         auto const subsub = compat::getSubExprAsWritten(sub);
         if (subsub->getType().IgnoreParens() == expr->getType().IgnoreParens()
             && isBool(subsub))
@@ -770,7 +749,7 @@ bool ImplicitBoolConversion::VisitMaterializeTemporaryExpr(
                 DiagnosticsEngine::Warning,
                 ("explicit conversion (%0) from %1 to %2 implicitly converted"
                  " back to %3"),
-                compat::getBeginLoc(expr))
+                expr->getBeginLoc())
                 << sub->getCastKindName() << subsub->getType() << 
sub->getType()
                 << expr->getType() << expr->getSourceRange();
             return true;
@@ -895,7 +874,7 @@ void ImplicitBoolConversion::reportWarning(ImplicitCastExpr 
const * expr) {
         }
         report(
             DiagnosticsEngine::Warning,
-            "implicit conversion (%0) from %1 to %2", 
compat::getBeginLoc(expr))
+            "implicit conversion (%0) from %1 to %2", expr->getBeginLoc())
             << expr->getCastKindName() << 
expr->getSubExprAsWritten()->getType()
             << expr->getType() << expr->getSourceRange();
     }
diff --git a/compilerplugins/clang/includeform.cxx 
b/compilerplugins/clang/includeform.cxx
index 9d6587506a85..d9e603351783 100644
--- a/compilerplugins/clang/includeform.cxx
+++ b/compilerplugins/clang/includeform.cxx
@@ -29,11 +29,7 @@ private:
     void InclusionDirective(
         SourceLocation HashLoc, Token const & IncludeTok, StringRef,
         bool IsAngled, CharSourceRange FilenameRange, FileEntry const * File,
-        StringRef SearchPath, StringRef, clang::Module const *
-#if CLANG_VERSION >= 70000
-        , SrcMgr::CharacteristicKind
-#endif
-        ) override
+        StringRef SearchPath, StringRef, clang::Module const *, 
SrcMgr::CharacteristicKind) override
     {
         if (ignoreLocation(HashLoc)) {
             return;
diff --git a/compilerplugins/clang/indentation.cxx 
b/compilerplugins/clang/indentation.cxx
index 2dda32f8174c..9ac5f3d7e521 100644
--- a/compilerplugins/clang/indentation.cxx
+++ b/compilerplugins/clang/indentation.cxx
@@ -16,6 +16,7 @@
 #include <fstream>
 #include <set>
 #include <unordered_set>
+#include "config_clang.h"
 #include "plugin.hxx"
 
 /*
@@ -118,7 +119,7 @@ bool Indentation::VisitCompoundStmt(CompoundStmt const* 
compoundStmt)
     {
         auto stmt = *i;
         auto const actualPrevEnd = prevEnd;
-        prevEnd = compat::getEndLoc(stmt); // compute early, before below 
`continue`s
+        prevEnd = stmt->getEndLoc(); // compute early, before below `continue`s
 
         // these show up in macro expansions, not interesting
         if (isa<NullStmt>(stmt))
@@ -126,28 +127,8 @@ bool Indentation::VisitCompoundStmt(CompoundStmt const* 
compoundStmt)
         // these are always weirdly indented
         if (isa<LabelStmt>(stmt))
             continue;
-#if CLANG_VERSION < 100000
-        // Before
-        // 
<https://github.com/llvm/llvm-project/commit/dc3957ec215dd17b8d293461f18696566637a6cd>
-        // "Include leading attributes in DeclStmt's SourceRange", getBeginLoc 
of a VarDecl DeclStmt
-        // with an UnusedAttr pointed after the attr (and getLocation of the 
attr pointed at
-        // "maybe_unused", not at the leading "[["), so just ignore those in 
old compiler versions:
-        if (auto const declStmt = dyn_cast<DeclStmt>(stmt))
-        {
-            if (declStmt->decl_begin() != declStmt->decl_end())
-            {
-                if (auto const decl = 
dyn_cast<VarDecl>(*declStmt->decl_begin()))
-                {
-                    if (decl->hasAttr<UnusedAttr>())
-                    {
-                        continue;
-                    }
-                }
-            }
-        }
-#endif
 
-        auto stmtLoc = compat::getBeginLoc(stmt);
+        auto stmtLoc = stmt->getBeginLoc();
 
         StringRef macroName;
         bool partOfMacro = false;
@@ -165,11 +146,7 @@ bool Indentation::VisitCompoundStmt(CompoundStmt const* 
compoundStmt)
             // similar thing in forms/
             if (macroName == "DECL_IFACE_PROP_IMPL" || macroName == 
"DECL_BOOL_PROP_IMPL")
                 continue;
-#if CLANG_VERSION >= 70000
             stmtLoc = SM.getExpansionRange(stmtLoc).getBegin();
-#else
-            stmtLoc = SM.getExpansionRange(stmtLoc).first;
-#endif
         }
 
         // check for comment to the left of the statement
@@ -211,13 +188,12 @@ bool Indentation::VisitCompoundStmt(CompoundStmt const* 
compoundStmt)
         {
             if (containsPreprocessingConditionalInclusion(SourceRange(
                     
locationAfterToken(compiler.getSourceManager().getExpansionLoc(actualPrevEnd)),
-                    
compiler.getSourceManager().getExpansionLoc(compat::getBeginLoc(stmt)))))
+                    
compiler.getSourceManager().getExpansionLoc(stmt->getBeginLoc()))))
                 continue;
             report(DiagnosticsEngine::Warning, "statement mis-aligned compared 
to neighbours %0",
                    stmtLoc)
                 << macroName;
-            report(DiagnosticsEngine::Note, "measured against this one",
-                   compat::getBeginLoc(firstStmt));
+            report(DiagnosticsEngine::Note, "measured against this one", 
firstStmt->getBeginLoc());
             //getParentStmt(compoundStmt)->dump();
             //stmt->dump();
         }
@@ -228,7 +204,7 @@ bool Indentation::VisitCompoundStmt(CompoundStmt const* 
compoundStmt)
                 auto bodyStmt = ifStmt->getThen();
                 if (bodyStmt && !isa<CompoundStmt>(bodyStmt))
                 {
-                    stmtLoc = compat::getBeginLoc(bodyStmt);
+                    stmtLoc = bodyStmt->getBeginLoc();
                     invalid1 = false;
                     invalid2 = false;
                     unsigned bodyColumn = SM.getPresumedColumnNumber(stmtLoc, 
&invalid1);
@@ -243,7 +219,7 @@ bool Indentation::VisitCompoundStmt(CompoundStmt const* 
compoundStmt)
                 auto elseStmt = ifStmt->getElse();
                 if (elseStmt && !isa<CompoundStmt>(elseStmt) && 
!isa<IfStmt>(elseStmt))
                 {
-                    stmtLoc = compat::getBeginLoc(elseStmt);
+                    stmtLoc = elseStmt->getBeginLoc();
                     invalid1 = false;
                     invalid2 = false;
                     unsigned elseColumn = SM.getPresumedColumnNumber(stmtLoc, 
&invalid1);
@@ -340,7 +316,7 @@ void Indentation::checkCompoundStmtBraces(const Stmt* 
parentStmt, const Compound
     bool invalid1 = false;
     bool invalid2 = false;
 
-    auto parentBeginLoc = compat::getBeginLoc(parentStmt);
+    auto parentBeginLoc = parentStmt->getBeginLoc();
     unsigned parentColumn = SM.getPresumedColumnNumber(parentBeginLoc, 
&invalid1);
     if (invalid1)
         return;
@@ -405,7 +381,7 @@ void Indentation::checkCompoundStmtBraces(const Stmt* 
parentStmt, const Compound
     auto firstStmt = compoundStmt->body_front();
     if (isa<LabelStmt>(firstStmt))
         return;
-    auto firstStmtLoc = compat::getBeginLoc(firstStmt);
+    auto firstStmtLoc = firstStmt->getBeginLoc();
     unsigned firstStmtBeginColumn = SM.getPresumedColumnNumber(firstStmtLoc, 
&invalid1);
     if (invalid1)
         return;
@@ -440,7 +416,7 @@ bool Indentation::VisitSwitchStmt(SwitchStmt const* 
switchStmt)
         if (!caseStmt)
             continue;
 
-        auto stmtLoc = compat::getBeginLoc(caseStmt);
+        auto stmtLoc = caseStmt->getBeginLoc();
 
         bool invalid1 = false;
         bool invalid2 = false;
@@ -466,7 +442,7 @@ bool Indentation::VisitSwitchStmt(SwitchStmt const* 
switchStmt)
             //            report(DiagnosticsEngine::Warning, "statement 
mis-aligned compared to neighbours",
             //                   stmtLoc);
             //            report(DiagnosticsEngine::Note, "measured against 
this one",
-            //                   compat::getBeginLoc(firstStmt));
+            //                   firstStmt->getBeginLoc());
             //getParentStmt(compoundStmt)->dump();
             //stmt->dump();
         }
diff --git a/compilerplugins/clang/inlinesimplememberfunctions.cxx 
b/compilerplugins/clang/inlinesimplememberfunctions.cxx
index 668e9f252ab6..760094b5a03a 100644
--- a/compilerplugins/clang/inlinesimplememberfunctions.cxx
+++ b/compilerplugins/clang/inlinesimplememberfunctions.cxx
@@ -10,7 +10,6 @@
 #include <string>
 
 #include "plugin.hxx"
-#include "compat.hxx"
 
 // Methods that purely return a local field should be declared in the header 
and be declared inline.
 // So that the compiler can elide the function call and turn it into a simple 
fixed-offset-load instruction.
@@ -243,8 +242,8 @@ bool InlineSimpleMemberFunctions::rewrite(const 
CXXMethodDecl * functionDecl) {
     const char *p1, *p2;
 
     // get the function body contents
-    p1 = compiler.getSourceManager().getCharacterData( 
compat::getBeginLoc(functionDecl->getBody()) );
-    p2 = compiler.getSourceManager().getCharacterData( 
compat::getEndLoc(functionDecl->getBody()) );
+    p1 = compiler.getSourceManager().getCharacterData( 
functionDecl->getBody()->getBeginLoc() );
+    p2 = compiler.getSourceManager().getCharacterData( 
functionDecl->getBody()->getEndLoc() );
     std::string s1( p1, p2 - p1 + 1);
 
     /* we can't safely move around stuff containing comments, we mess up the 
resulting code */
@@ -274,18 +273,18 @@ bool InlineSimpleMemberFunctions::rewrite(const 
CXXMethodDecl * functionDecl) {
     // remove the function's out of line body and declaration
     RewriteOptions opts;
     opts.RemoveLineIfEmpty = true;
-    if (!removeText(SourceRange(compat::getBeginLoc(functionDecl), 
compat::getEndLoc(functionDecl->getBody())), opts)) {
+    if (!removeText(SourceRange(functionDecl->getBeginLoc(), 
functionDecl->getBody()->getEndLoc()), opts)) {
         return false;
     }
 
     // scan forward until we find the semicolon
     const FunctionDecl * canonicalDecl = functionDecl->getCanonicalDecl();
-    p1 = compiler.getSourceManager().getCharacterData( 
compat::getEndLoc(canonicalDecl) );
+    p1 = compiler.getSourceManager().getCharacterData( 
canonicalDecl->getEndLoc() );
     p2 = ++p1;
     while (*p2 != 0 && *p2 != ';') p2++;
 
     // insert the function body into the inline function definition (i.e. the 
one inside the class definition)
-    return replaceText(compat::getEndLoc(canonicalDecl).getLocWithOffset(p2 - 
p1 + 1), 1, s1);
+    return replaceText(canonicalDecl->getEndLoc().getLocWithOffset(p2 - p1 + 
1), 1, s1);
 }
 
 loplugin::Plugin::Registration< InlineSimpleMemberFunctions > 
X("inlinesimplememberfunctions");
diff --git a/compilerplugins/clang/intvsfloat.cxx 
b/compilerplugins/clang/intvsfloat.cxx
index d89b34155cce..771e2bca0db5 100644
--- a/compilerplugins/clang/intvsfloat.cxx
+++ b/compilerplugins/clang/intvsfloat.cxx
@@ -10,7 +10,6 @@
 
 #include "plugin.hxx"
 #include "check.hxx"
-#include "compat.hxx"
 #include <iostream>
 
 /**
@@ -55,7 +54,7 @@ bool IntVsFloat::VisitVarDecl(VarDecl const* varDecl)
     if (static_cast<long>(*d) == *d)
         return true;
     report(DiagnosticsEngine::Warning, "assigning constant float value to int 
truncates data",
-           compat::getBeginLoc(init))
+           init->getBeginLoc())
         << init->getSourceRange();
 
     return true;
@@ -67,7 +66,7 @@ bool IntVsFloat::VisitBinaryOperator(BinaryOperator const* op)
     {
         return true;
     }
-    if (ignoreLocation(compat::getBeginLoc(op)))
+    if (ignoreLocation(op->getBeginLoc()))
         return true;
     auto lhs = op->getLHS()->IgnoreImpCasts();
     auto rhs = op->getRHS()->IgnoreImpCasts();
@@ -83,7 +82,7 @@ bool IntVsFloat::VisitBinaryOperator(BinaryOperator const* op)
     if (static_cast<long>(*d) == *d)
         return true;
     report(DiagnosticsEngine::Warning, "comparing integer to float constant, 
can never be true",
-           compat::getBeginLoc(op))
+           op->getBeginLoc())
         << op->getSourceRange();
     return true;
 }
diff --git a/compilerplugins/clang/literaltoboolconversion.cxx 
b/compilerplugins/clang/literaltoboolconversion.cxx
index 54521a60a209..9894daec51b6 100644

... etc. - the rest is truncated

Reply via email to