forked from OSchip/llvm-project
parent
049a4ffcb8
commit
9c256e379e
|
@ -4462,7 +4462,7 @@ CXCursor clang_getCursorDefinition(CXCursor C) {
|
|||
case Decl::CXXConversion: {
|
||||
const FunctionDecl *Def = 0;
|
||||
if (cast<FunctionDecl>(D)->getBody(Def))
|
||||
return MakeCXCursor(const_cast<FunctionDecl *>(Def), TU);
|
||||
return MakeCXCursor(Def, TU);
|
||||
return clang_getNullCursor();
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static CXCursorKind GetCursorKind(const Attr *A) {
|
|||
return CXCursor_UnexposedAttr;
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCXCursor(const Attr *A, Decl *Parent,
|
||||
CXCursor cxcursor::MakeCXCursor(const Attr *A, const Decl *Parent,
|
||||
CXTranslationUnit TU) {
|
||||
assert(A && Parent && TU && "Invalid arguments!");
|
||||
CXCursor C = { GetCursorKind(A), 0, { Parent, A, TU } };
|
||||
|
@ -89,7 +89,7 @@ CXCursor cxcursor::MakeCXCursor(const Decl *D, CXTranslationUnit TU,
|
|||
return C;
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCXCursor(const Stmt *S, Decl *Parent,
|
||||
CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent,
|
||||
CXTranslationUnit TU,
|
||||
SourceRange RegionOfInterest) {
|
||||
assert(S && TU && "Invalid arguments!");
|
||||
|
@ -830,7 +830,7 @@ void cxcursor::getOverriddenCursors(CXCursor cursor,
|
|||
|
||||
for (SmallVector<const NamedDecl *, 8>::iterator
|
||||
I = OverDecls.begin(), E = OverDecls.end(); I != E; ++I) {
|
||||
overridden.push_back(MakeCXCursor(const_cast<NamedDecl*>(*I), TU));
|
||||
overridden.push_back(MakeCXCursor(*I, TU));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,12 +48,12 @@ namespace cxcursor {
|
|||
|
||||
CXCursor getCursor(CXTranslationUnit, SourceLocation);
|
||||
|
||||
CXCursor MakeCXCursor(const clang::Attr *A, clang::Decl *Parent,
|
||||
CXCursor MakeCXCursor(const clang::Attr *A, const clang::Decl *Parent,
|
||||
CXTranslationUnit TU);
|
||||
CXCursor MakeCXCursor(const clang::Decl *D, CXTranslationUnit TU,
|
||||
SourceRange RegionOfInterest = SourceRange(),
|
||||
bool FirstInDeclGroup = true);
|
||||
CXCursor MakeCXCursor(const clang::Stmt *S, clang::Decl *Parent,
|
||||
CXCursor MakeCXCursor(const clang::Stmt *S, const clang::Decl *Parent,
|
||||
CXTranslationUnit TU,
|
||||
SourceRange RegionOfInterest = SourceRange());
|
||||
CXCursor MakeCXCursorInvalid(CXCursorKind K, CXTranslationUnit TU = 0);
|
||||
|
|
|
@ -69,7 +69,7 @@ AttrListInfo::AttrListInfo(const Decl *D, IndexingContext &IdxCtx)
|
|||
for (AttrVec::const_iterator AttrI = D->attr_begin(), AttrE = D->attr_end();
|
||||
AttrI != AttrE; ++AttrI) {
|
||||
const Attr *A = *AttrI;
|
||||
CXCursor C = MakeCXCursor(A, const_cast<Decl *>(D), IdxCtx.CXTU);
|
||||
CXCursor C = MakeCXCursor(A, D, IdxCtx.CXTU);
|
||||
CXIdxLoc Loc = IdxCtx.getIndexLoc(A->getLocation());
|
||||
switch (C.kind) {
|
||||
default:
|
||||
|
@ -644,8 +644,7 @@ bool IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc,
|
|||
if (!D)
|
||||
return false;
|
||||
|
||||
CXCursor Cursor = E ? MakeCXCursor(const_cast<Expr*>(E),
|
||||
const_cast<Decl*>(cast<Decl>(DC)), CXTU)
|
||||
CXCursor Cursor = E ? MakeCXCursor(E, cast<Decl>(DC), CXTU)
|
||||
: getRefCursor(D, Loc);
|
||||
return handleReference(D, Loc, Cursor, Parent, DC, E, Kind);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue