mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-16 21:58:08 +00:00
Better $cquery/vars
This commit is contained in:
parent
bf7ffb3c9d
commit
e4d4c7b139
@ -56,17 +56,30 @@ ClangType ClangType::get_canonical() const {
|
||||
}
|
||||
|
||||
ClangType ClangType::strip_qualifiers() const {
|
||||
// CXRefQualifierKind qualifiers = clang_Type_getCXXRefQualifier(cx_type)
|
||||
switch (cx_type.kind) {
|
||||
case CXType_LValueReference:
|
||||
case CXType_Pointer:
|
||||
case CXType_RValueReference:
|
||||
return clang_getPointeeType(cx_type);
|
||||
CXType cx = cx_type;
|
||||
while (1) {
|
||||
switch (cx.kind) {
|
||||
default:
|
||||
break;
|
||||
case CXType_ConstantArray:
|
||||
case CXType_DependentSizedArray:
|
||||
case CXType_IncompleteArray:
|
||||
case CXType_VariableArray:
|
||||
cx = clang_getElementType(cx);
|
||||
continue;
|
||||
case CXType_BlockPointer:
|
||||
case CXType_LValueReference:
|
||||
case CXType_MemberPointer:
|
||||
case CXType_ObjCObjectPointer:
|
||||
case CXType_Pointer:
|
||||
case CXType_RValueReference:
|
||||
cx = clang_getPointeeType(cx);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return cx_type;
|
||||
return cx;
|
||||
}
|
||||
|
||||
std::string ClangType::get_spelling() const {
|
||||
|
Loading…
Reference in New Issue
Block a user