aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/c-index-test/c-index-test.c2
-rw-r--r--tools/libclang/CXTypes.cpp7
-rw-r--r--tools/libclang/libclang.darwin.exports1
-rw-r--r--tools/libclang/libclang.exports1
4 files changed, 11 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index b8d4cb8917..795c19c0cb 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -487,6 +487,8 @@ static enum CXChildVisitResult PrintTypeKind(CXCursor cursor, CXCursor p,
clang_disposeString(RS);
}
}
+ /* Print if this is a non-POD type. */
+ printf(" [isPOD=%d]", clang_isPODType(T));
printf("\n");
}
diff --git a/tools/libclang/CXTypes.cpp b/tools/libclang/CXTypes.cpp
index d5c9f45210..b49ef191e3 100644
--- a/tools/libclang/CXTypes.cpp
+++ b/tools/libclang/CXTypes.cpp
@@ -283,4 +283,11 @@ CXType clang_getCursorResultType(CXCursor C) {
return MakeCXType(QualType(), cxcursor::getCursorASTUnit(C));
}
+unsigned clang_isPODType(CXType X) {
+ QualType T = GetQualType(X);
+ if (!T.getTypePtr())
+ return 0;
+ return T->isPODType() ? 1 : 0;
+}
+
} // end: extern "C"
diff --git a/tools/libclang/libclang.darwin.exports b/tools/libclang/libclang.darwin.exports
index e51620c786..50ed994b1f 100644
--- a/tools/libclang/libclang.darwin.exports
+++ b/tools/libclang/libclang.darwin.exports
@@ -82,6 +82,7 @@ _clang_isDeclaration
_clang_isExpression
_clang_isInvalid
_clang_isPreprocessing
+_clang_isPODType
_clang_isReference
_clang_isStatement
_clang_isTranslationUnit
diff --git a/tools/libclang/libclang.exports b/tools/libclang/libclang.exports
index 3d3e7138c8..752c6504c9 100644
--- a/tools/libclang/libclang.exports
+++ b/tools/libclang/libclang.exports
@@ -82,6 +82,7 @@ clang_isDeclaration
clang_isExpression
clang_isInvalid
clang_isPreprocessing
+clang_isPODType
clang_isReference
clang_isStatement
clang_isTranslationUnit