diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-07-30 00:14:11 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-07-30 00:14:11 +0000 |
| commit | 0c7476ad590d2263111430b5654127d2003afdca (patch) | |
| tree | b26c9fd0cdb58155575037db0ad5054a95422e6f /clang/tools | |
| parent | 56c38bda40424d1ccfc44fd6ba788902065a9325 (diff) | |
| download | bcm5719-llvm-0c7476ad590d2263111430b5654127d2003afdca.tar.gz bcm5719-llvm-0c7476ad590d2263111430b5654127d2003afdca.zip | |
Add clang_isPODType() for querying if the CXType is POD. Implements <rdar://problem/8250669>.
llvm-svn: 109822
Diffstat (limited to 'clang/tools')
| -rw-r--r-- | clang/tools/c-index-test/c-index-test.c | 2 | ||||
| -rw-r--r-- | clang/tools/libclang/CXTypes.cpp | 7 | ||||
| -rw-r--r-- | clang/tools/libclang/libclang.darwin.exports | 1 | ||||
| -rw-r--r-- | clang/tools/libclang/libclang.exports | 1 |
4 files changed, 11 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index b8d4cb89178..795c19c0cb5 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/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/clang/tools/libclang/CXTypes.cpp b/clang/tools/libclang/CXTypes.cpp index d5c9f452100..b49ef191e3c 100644 --- a/clang/tools/libclang/CXTypes.cpp +++ b/clang/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/clang/tools/libclang/libclang.darwin.exports b/clang/tools/libclang/libclang.darwin.exports index e51620c7864..50ed994b1fe 100644 --- a/clang/tools/libclang/libclang.darwin.exports +++ b/clang/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/clang/tools/libclang/libclang.exports b/clang/tools/libclang/libclang.exports index 3d3e7138c86..752c6504c9b 100644 --- a/clang/tools/libclang/libclang.exports +++ b/clang/tools/libclang/libclang.exports @@ -82,6 +82,7 @@ clang_isDeclaration clang_isExpression clang_isInvalid clang_isPreprocessing +clang_isPODType clang_isReference clang_isStatement clang_isTranslationUnit |

