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

Stephan Bergmann sbergman at redhat.com
Thu Mar 27 02:24:35 PDT 2014


 compilerplugins/clang/compat.hxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 26f6ff08291848212a2f844878c1e330c4fa6349
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 27 09:51:01 2014 +0100

    More compat stuff
    
    (currently only used by a not-yet committed plugin, though)
    
    Change-Id: I4cff7eb97dbe10a44a911be9db090ea8cd10d8f0

diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index f100f25..1f025e7 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -24,6 +24,14 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/raw_ostream.h"
 
+#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3
+#define LO_COMPILERPLUGINS_CLANG_COMPAT_HAVE_isAtEndOfImmediateMacroExpansion \
+    true
+#else
+#define LO_COMPILERPLUGINS_CLANG_COMPAT_HAVE_isAtEndOfImmediateMacroExpansion \
+    false
+#endif
+
 // Compatibility wrapper to abstract over (trivial) changes in the Clang API:
 namespace compat {
 
@@ -43,6 +51,14 @@ inline bool isExternCContext(clang::DeclContext const & ctxt) {
 #endif
 }
 
+inline bool isFirstDecl(clang::FunctionDecl const & decl) {
+#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3
+    return decl.isFirstDecl();
+#else
+    return decl.isFirstDeclaration();
+#endif
+}
+
 inline clang::QualType getReturnType(clang::FunctionDecl const & decl) {
 #if (__clang_major__ == 3 && __clang_minor__ >= 5) || __clang_major__ > 3
     return decl.getReturnType();


More information about the Libreoffice-commits mailing list