summaryrefslogtreecommitdiffstats
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/compat.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index f100f255d64a..1f025e70472f 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();