diff options
Diffstat (limited to 'compilerplugins/clang/returnbyref.cxx')
-rw-r--r-- | compilerplugins/clang/returnbyref.cxx | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/compilerplugins/clang/returnbyref.cxx b/compilerplugins/clang/returnbyref.cxx index b5f32eef5cc5..59bee67f9531 100644 --- a/compilerplugins/clang/returnbyref.cxx +++ b/compilerplugins/clang/returnbyref.cxx @@ -34,9 +34,6 @@ public: virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } bool VisitCXXMethodDecl(const CXXMethodDecl * decl); -private: - bool isInUnoIncludeFile(SourceLocation spellingLocation) const; - bool isInMainFile(SourceLocation spellingLocation) const; }; bool ReturnByRef::VisitCXXMethodDecl(const CXXMethodDecl * functionDecl) { @@ -118,35 +115,6 @@ bool ReturnByRef::VisitCXXMethodDecl(const CXXMethodDecl * functionDecl) { return true; } -bool ReturnByRef::isInUnoIncludeFile(SourceLocation spellingLocation) const { - StringRef name { - compiler.getSourceManager().getFilename(spellingLocation) }; - return isInMainFile(spellingLocation) - ? (name == SRCDIR "/cppu/source/cppu/compat.cxx" - || name == SRCDIR "/cppuhelper/source/compat.cxx" - || name == SRCDIR "/sal/osl/all/compat.cxx") - : (name.startswith(SRCDIR "/include/com/") - || name.startswith(SRCDIR "/include/cppu/") - || name.startswith(SRCDIR "/include/cppuhelper/") - || name.startswith(SRCDIR "/include/osl/") - || name.startswith(SRCDIR "/include/rtl/") - || name.startswith(SRCDIR "/include/sal/") - || name.startswith(SRCDIR "/include/salhelper/") - || name.startswith(SRCDIR "/include/systools/") - || name.startswith(SRCDIR "/include/typelib/") - || name.startswith(SRCDIR "/include/uno/") - || name.startswith(SRCDIR "/workdir/") - || name == SRCDIR "/include/comphelper/implbase_var.hxx"); -} - -bool ReturnByRef::isInMainFile(SourceLocation spellingLocation) const { -#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3 - return compiler.getSourceManager().isInMainFile(spellingLocation); -#else - return compiler.getSourceManager().isFromMainFile(spellingLocation); -#endif -} - loplugin::Plugin::Registration< ReturnByRef > X("returnbyref"); } |