[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 22 08:18:18 UTC 2021


 compilerplugins/clang/compat.hxx        |    6 ++++++
 compilerplugins/clang/pluginhandler.cxx |    3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 6b975a48e8b6dba2853e8d7eb03fbd6f8aa1aad8
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jun 22 08:10:58 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Jun 22 10:17:41 2021 +0200

    Adapt compilerplugins to llvm::sys::fs::OF_None rename
    
    ...from F_None, which happened with
    <https://github.com/llvm/llvm-project/commit/1f67a3cba9b09636c56e2109d8a35ae96dc15782>
    "[FileSystem] Split up the OpenFlags enumeration" towards LLVM 7, originally
    leaving the alternative F_None spelling in for compatibility, but which was
    finally removed now with
    <https://github.com/llvm/llvm-project/commit/3302af9d4c39642bebe64dd60a3aa162fefc44b2>
    "Support: Remove F_{None,Text,Append} compatibility synonyms, NFC".
    
    Change-Id: Iea1192b5ee351c13ea5d6701887f3aba62133c20
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117609
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index c9b2bc35b5f6..d04538e164b7 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -346,6 +346,12 @@ inline bool isPtrMemOp(clang::BinaryOperatorKind op) {
 #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
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 315062969b25..35b5e03298b4 100644
--- a/compilerplugins/clang/pluginhandler.cxx
+++ b/compilerplugins/clang/pluginhandler.cxx
@@ -13,6 +13,7 @@
 #include <system_error>
 #include <utility>
 
+#include "compat.hxx"
 #include "plugin.hxx"
 #include "pluginhandler.hxx"
 
@@ -392,7 +393,7 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
         bool bOk = false;
         std::error_code ec;
         std::unique_ptr<raw_fd_ostream> ostream(
-            new raw_fd_ostream(filename, ec, sys::fs::F_None));
+            new raw_fd_ostream(filename, ec, compat::OF_None));
         if( !ec)
         {
             it->second.write( *ostream );


More information about the Libreoffice-commits mailing list