diff options
Diffstat (limited to 'compilerplugins/clang/finalclasses.cxx')
-rw-r--r-- | compilerplugins/clang/finalclasses.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compilerplugins/clang/finalclasses.cxx b/compilerplugins/clang/finalclasses.cxx index 447e3406e5e6..2d19dd67d703 100644 --- a/compilerplugins/clang/finalclasses.cxx +++ b/compilerplugins/clang/finalclasses.cxx @@ -11,6 +11,8 @@ #include <set> #include <string> #include <iostream> +#include "config_clang.h" +#include "compat.hxx" #include "plugin.hxx" #include <fstream> @@ -46,6 +48,8 @@ public: virtual void run() override { + handler.enableTreeWideAnalysisMode(); + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); // dump all our output in one write call - this is to try and limit IO "crosstalk" between multiple processes @@ -73,8 +77,9 @@ private: bool ignoreClass(StringRef s) { // ignore stuff in the standard library, and UNO stuff we can't touch. - if (s.startswith("rtl::") || s.startswith("sal::") || s.startswith("com::sun::") - || s.startswith("std::") || s.startswith("boost::") + if (compat::starts_with(s, "rtl::") || compat::starts_with(s, "sal::") + || compat::starts_with(s, "com::sun::") || compat::starts_with(s, "std::") + || compat::starts_with(s, "boost::") || s == "OString" || s == "OUString" || s == "bad_alloc") { return true; @@ -131,7 +136,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)); |