[llvm-branch-commits] [cfe-branch] r105117 - /cfe/branches/Apple/whitney/tools/libclang/CXTypes.cpp
Daniel Dunbar
daniel at zuster.org
Sat May 29 17:12:15 PDT 2010
Author: ddunbar
Date: Sat May 29 19:12:15 2010
New Revision: 105117
URL: http://llvm.org/viewvc/llvm-project?rev=105117&view=rev
Log:
Merge r105111:
--
Author: Ted Kremenek <kremenek at apple.com>
Date: Sat May 29 20:01:52 2010 +0000
Add check for an invalid CXType in clang_getTypeDeclaration.
Modified:
cfe/branches/Apple/whitney/tools/libclang/CXTypes.cpp
Modified: cfe/branches/Apple/whitney/tools/libclang/CXTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/tools/libclang/CXTypes.cpp?rev=105117&r1=105116&r2=105117&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/tools/libclang/CXTypes.cpp (original)
+++ cfe/branches/Apple/whitney/tools/libclang/CXTypes.cpp Sat May 29 19:12:15 2010
@@ -165,8 +165,15 @@
}
CXCursor clang_getTypeDeclaration(CXType CT) {
+ if (CT.kind == CXType_Invalid)
+ return cxcursor::MakeCXCursorInvalid(CXCursor_NoDeclFound);
+
QualType T = GetQualType(CT);
Type *TP = T.getTypePtr();
+
+ if (!TP)
+ return cxcursor::MakeCXCursorInvalid(CXCursor_NoDeclFound);
+
Decl *D = 0;
switch (TP->getTypeClass()) {
More information about the llvm-branch-commits
mailing list