pet 0.11.8
[pet.git] / clang_compatibility.h
blobc6617c3114514aede117d965b5d6278753e15da9
1 #ifndef PET_CLANG_COMPATIBILITY_H
2 #define PET_CLANG_COMPATIBILITY_H
4 #include "config.h"
6 #include <clang/AST/Type.h>
8 #ifdef HAVE_BEGIN_END_LOC
9 template <typename T>
10 inline clang::SourceLocation begin_loc(T *decl)
12 return decl->getBeginLoc();
14 template <typename T>
15 inline clang::SourceLocation end_loc(T *decl)
17 return decl->getEndLoc();
19 #else
20 template <typename T>
21 inline clang::SourceLocation begin_loc(T *decl)
23 return decl->getLocStart();
25 template <typename T>
26 inline clang::SourceLocation end_loc(T *decl)
28 return decl->getLocEnd();
30 #endif
32 #ifdef USE_NESTED_ARRAY_SIZE_MODIFIER
33 using ArraySizeModifier = clang::ArrayType::ArraySizeModifier;
34 #endif
36 #endif