forked from OSchip/llvm-project
parent
3ff8ef9eb7
commit
43ed98b9dd
|
@ -144,7 +144,7 @@ extern "C" {
|
|||
|
||||
CXType clang_getCursorType(CXCursor C) {
|
||||
using namespace cxcursor;
|
||||
|
||||
|
||||
CXTranslationUnit TU = cxcursor::getCursorTU(C);
|
||||
if (!TU)
|
||||
return MakeCXType(QualType(), TU);
|
||||
|
@ -174,7 +174,7 @@ CXType clang_getCursorType(CXCursor C) {
|
|||
return MakeCXType(FTD->getTemplatedDecl()->getType(), TU);
|
||||
return MakeCXType(QualType(), TU);
|
||||
}
|
||||
|
||||
|
||||
if (clang_isReference(C.kind)) {
|
||||
switch (C.kind) {
|
||||
case CXCursor_ObjCSuperClassRef: {
|
||||
|
@ -182,18 +182,18 @@ CXType clang_getCursorType(CXCursor C) {
|
|||
= Context.getObjCInterfaceType(getCursorObjCSuperClassRef(C).first);
|
||||
return MakeCXType(T, TU);
|
||||
}
|
||||
|
||||
|
||||
case CXCursor_ObjCClassRef: {
|
||||
QualType T = Context.getObjCInterfaceType(getCursorObjCClassRef(C).first);
|
||||
return MakeCXType(T, TU);
|
||||
}
|
||||
|
||||
|
||||
case CXCursor_TypeRef: {
|
||||
QualType T = Context.getTypeDeclType(getCursorTypeRef(C).first);
|
||||
return MakeCXType(T, TU);
|
||||
|
||||
}
|
||||
|
||||
|
||||
case CXCursor_CXXBaseSpecifier:
|
||||
return cxtype::MakeCXType(getCursorCXXBaseSpecifier(C)->getType(), TU);
|
||||
|
||||
|
@ -210,7 +210,7 @@ CXType clang_getCursorType(CXCursor C) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return MakeCXType(QualType(), TU);
|
||||
}
|
||||
|
||||
|
@ -348,10 +348,10 @@ unsigned clang_isRestrictQualifiedType(CXType CT) {
|
|||
CXType clang_getPointeeType(CXType CT) {
|
||||
QualType T = GetQualType(CT);
|
||||
const Type *TP = T.getTypePtrOrNull();
|
||||
|
||||
|
||||
if (!TP)
|
||||
return MakeCXType(QualType(), GetTU(CT));
|
||||
|
||||
|
||||
switch (TP->getTypeClass()) {
|
||||
case Type::Pointer:
|
||||
T = cast<PointerType>(TP)->getPointeeType();
|
||||
|
@ -410,7 +410,7 @@ try_again:
|
|||
D = cast<TemplateSpecializationType>(TP)->getTemplateName()
|
||||
.getAsTemplateDecl();
|
||||
break;
|
||||
|
||||
|
||||
case Type::InjectedClassName:
|
||||
D = cast<InjectedClassNameType>(TP)->getDecl();
|
||||
break;
|
||||
|
@ -420,7 +420,7 @@ try_again:
|
|||
case Type::Elaborated:
|
||||
TP = cast<ElaboratedType>(TP)->getNamedType().getTypePtrOrNull();
|
||||
goto try_again;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue