Kaydet (Commit) 26f6ff08 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More compat stuff

(currently only used by a not-yet committed plugin, though)

Change-Id: I4cff7eb97dbe10a44a911be9db090ea8cd10d8f0
üst b566aa7f
...@@ -24,6 +24,14 @@ ...@@ -24,6 +24,14 @@
#include "llvm/Support/FileSystem.h" #include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.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: // Compatibility wrapper to abstract over (trivial) changes in the Clang API:
namespace compat { namespace compat {
...@@ -43,6 +51,14 @@ inline bool isExternCContext(clang::DeclContext const & ctxt) { ...@@ -43,6 +51,14 @@ inline bool isExternCContext(clang::DeclContext const & ctxt) {
#endif #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) { inline clang::QualType getReturnType(clang::FunctionDecl const & decl) {
#if (__clang_major__ == 3 && __clang_minor__ >= 5) || __clang_major__ > 3 #if (__clang_major__ == 3 && __clang_minor__ >= 5) || __clang_major__ > 3
return decl.getReturnType(); return decl.getReturnType();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment