Kill CXCursor_ObjCSelectorRef, CXCursor_VarRef, CXCursor_FunctionRef,

and CXCursor_EnumConstantRef; they've been subsumed by expression
references, which do a much nicer job.

llvm-svn: 93947
This commit is contained in:
Douglas Gregor 2010-01-19 23:25:01 +00:00
parent 8f40bbee78
commit 084236fafd
3 changed files with 1 additions and 54 deletions

View File

@ -113,12 +113,7 @@ enum CXCursorKind {
CXCursor_ObjCSuperClassRef = 40,
CXCursor_ObjCProtocolRef = 41,
CXCursor_ObjCClassRef = 42,
CXCursor_ObjCSelectorRef = 43, /* Expression references */
CXCursor_VarRef = 44,
CXCursor_FunctionRef = 45,
CXCursor_EnumConstantRef = 46,
CXCursor_LastRef = 46,
CXCursor_LastRef = 42,
/* Error conditions */
CXCursor_FirstInvalid = 70,

View File

@ -818,20 +818,6 @@ CXString clang_getCursorSpelling(CXCursor C) {
assert(OID && "getCursorSpelling(): Missing protocol decl");
return CIndexer::createCXString(OID->getIdentifier()->getNameStart());
}
case CXCursor_ObjCSelectorRef: {
ObjCMessageExpr *OME = dyn_cast<ObjCMessageExpr>(getCursorStmt(C));
assert(OME && "getCursorSpelling(): Missing message expr");
return CIndexer::createCXString(OME->getSelector().getAsString().c_str(),
true);
}
case CXCursor_VarRef:
case CXCursor_FunctionRef:
case CXCursor_EnumConstantRef: {
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(getCursorStmt(C));
assert(DRE && "getCursorSpelling(): Missing decl ref expr");
return CIndexer::createCXString(DRE->getDecl()->getIdentifier()
->getNameStart());
}
default:
return CIndexer::createCXString("<not implemented>");
}
@ -872,10 +858,6 @@ const char *clang_getCursorKindSpelling(enum CXCursorKind Kind) {
case CXCursor_ObjCSuperClassRef: return "ObjCSuperClassRef";
case CXCursor_ObjCProtocolRef: return "ObjCProtocolRef";
case CXCursor_ObjCClassRef: return "ObjCClassRef";
case CXCursor_ObjCSelectorRef: return "ObjCSelectorRef";
case CXCursor_VarRef: return "VarRef";
case CXCursor_FunctionRef: return "FunctionRef";
case CXCursor_EnumConstantRef: return "EnumConstantRef";
case CXCursor_UnexposedExpr: return "UnexposedExpr";
case CXCursor_DeclRefExpr: return "DeclRefExpr";
case CXCursor_MemberRefExpr: return "MemberRefExpr";
@ -1019,13 +1001,6 @@ CXSourceLocation clang_getCursorLocation(CXCursor C) {
return translateSourceLocation(P.first->getASTContext(), P.second);
}
case CXCursor_ObjCSelectorRef:
case CXCursor_VarRef:
case CXCursor_FunctionRef:
case CXCursor_EnumConstantRef:
return translateSourceLocation(getCursorContext(C),
getLocationFromExpr(getCursorExpr(C)));
default:
// FIXME: Need a way to enumerate all non-reference cases.
llvm_unreachable("Missed a reference kind");
@ -1070,13 +1045,6 @@ CXSourceRange clang_getCursorExtent(CXCursor C) {
return translateSourceRange(P.first->getASTContext(), P.second);
}
case CXCursor_ObjCSelectorRef:
case CXCursor_VarRef:
case CXCursor_FunctionRef:
case CXCursor_EnumConstantRef:
return translateSourceRange(getCursorContext(C),
getCursorExpr(C)->getSourceRange());
default:
// FIXME: Need a way to enumerate all non-reference cases.
llvm_unreachable("Missed a reference kind");
@ -1120,16 +1088,6 @@ CXCursor clang_getCursorReferenced(CXCursor C) {
case CXCursor_ObjCClassRef:
return MakeCXCursor(getCursorObjCClassRef(C).first);
case CXCursor_ObjCSelectorRef:
case CXCursor_VarRef:
case CXCursor_FunctionRef:
case CXCursor_EnumConstantRef: {
Decl *D = getDeclFromExpr(getCursorExpr(C));
if (D)
return MakeCXCursor(D);
break;
}
default:
// We would prefer to enumerate all non-reference cursor kinds here.
llvm_unreachable("Unhandled reference cursor kind");

View File

@ -306,12 +306,6 @@ ASTContext &cxcursor::getCursorContext(CXCursor Cursor) {
case CXCursor_ObjCClassRef:
return static_cast<Decl *>(Cursor.data[0])->getASTContext();
case CXCursor_ObjCSelectorRef:
case CXCursor_VarRef:
case CXCursor_FunctionRef:
case CXCursor_EnumConstantRef:
return *static_cast<ASTContext *>(Cursor.data[2]);
case CXCursor_InvalidFile:
case CXCursor_NoDeclFound:
case CXCursor_NotImplemented: