aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/CXType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/CXType.cpp')
-rw-r--r--tools/libclang/CXType.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/libclang/CXType.cpp b/tools/libclang/CXType.cpp
index d7751d2071..a574aa44ae 100644
--- a/tools/libclang/CXType.cpp
+++ b/tools/libclang/CXType.cpp
@@ -141,19 +141,19 @@ CXType clang_getCursorType(CXCursor C) {
}
if (clang_isDeclaration(C.kind)) {
- Decl *D = cxcursor::getCursorDecl(C);
+ const Decl *D = cxcursor::getCursorDecl(C);
if (!D)
return MakeCXType(QualType(), TU);
- if (TypeDecl *TD = dyn_cast<TypeDecl>(D))
+ if (const TypeDecl *TD = dyn_cast<TypeDecl>(D))
return MakeCXType(Context.getTypeDeclType(TD), TU);
- if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D))
+ if (const ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D))
return MakeCXType(Context.getObjCInterfaceType(ID), TU);
- if (ValueDecl *VD = dyn_cast<ValueDecl>(D))
+ if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
return MakeCXType(VD->getType(), TU);
- if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(D))
+ if (const ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(D))
return MakeCXType(PD->getType(), TU);
- if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
+ if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
return MakeCXType(FD->getType(), TU);
return MakeCXType(QualType(), TU);
}
@@ -205,9 +205,9 @@ CXType clang_getTypedefDeclUnderlyingType(CXCursor C) {
CXTranslationUnit TU = cxcursor::getCursorTU(C);
if (clang_isDeclaration(C.kind)) {
- Decl *D = cxcursor::getCursorDecl(C);
+ const Decl *D = cxcursor::getCursorDecl(C);
- if (TypedefNameDecl *TD = dyn_cast_or_null<TypedefNameDecl>(D)) {
+ if (const TypedefNameDecl *TD = dyn_cast_or_null<TypedefNameDecl>(D)) {
QualType T = TD->getUnderlyingType();
return MakeCXType(T, TU);
}
@@ -223,9 +223,9 @@ CXType clang_getEnumDeclIntegerType(CXCursor C) {
CXTranslationUnit TU = cxcursor::getCursorTU(C);
if (clang_isDeclaration(C.kind)) {
- Decl *D = cxcursor::getCursorDecl(C);
+ const Decl *D = cxcursor::getCursorDecl(C);
- if (EnumDecl *TD = dyn_cast_or_null<EnumDecl>(D)) {
+ if (const EnumDecl *TD = dyn_cast_or_null<EnumDecl>(D)) {
QualType T = TD->getIntegerType();
return MakeCXType(T, TU);
}
@@ -240,9 +240,9 @@ long long clang_getEnumConstantDeclValue(CXCursor C) {
using namespace cxcursor;
if (clang_isDeclaration(C.kind)) {
- Decl *D = cxcursor::getCursorDecl(C);
+ const Decl *D = cxcursor::getCursorDecl(C);
- if (EnumConstantDecl *TD = dyn_cast_or_null<EnumConstantDecl>(D)) {
+ if (const EnumConstantDecl *TD = dyn_cast_or_null<EnumConstantDecl>(D)) {
return TD->getInitVal().getSExtValue();
}
@@ -256,9 +256,9 @@ unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C) {
using namespace cxcursor;
if (clang_isDeclaration(C.kind)) {
- Decl *D = cxcursor::getCursorDecl(C);
+ const Decl *D = cxcursor::getCursorDecl(C);
- if (EnumConstantDecl *TD = dyn_cast_or_null<EnumConstantDecl>(D)) {
+ if (const EnumConstantDecl *TD = dyn_cast_or_null<EnumConstantDecl>(D)) {
return TD->getInitVal().getZExtValue();
}
@@ -272,9 +272,9 @@ int clang_getFieldDeclBitWidth(CXCursor C) {
using namespace cxcursor;
if (clang_isDeclaration(C.kind)) {
- Decl *D = getCursorDecl(C);
+ const Decl *D = getCursorDecl(C);
- if (FieldDecl *FD = dyn_cast_or_null<FieldDecl>(D)) {
+ if (const FieldDecl *FD = dyn_cast_or_null<FieldDecl>(D)) {
if (FD->isBitField())
return FD->getBitWidthValue(getCursorContext(C));
}
@@ -536,7 +536,7 @@ CXType clang_getResultType(CXType X) {
CXType clang_getCursorResultType(CXCursor C) {
if (clang_isDeclaration(C.kind)) {
- Decl *D = cxcursor::getCursorDecl(C);
+ const Decl *D = cxcursor::getCursorDecl(C);
if (const ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(D))
return MakeCXType(MD->getResultType(), cxcursor::getCursorTU(C));