mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Fix called_id
This commit is contained in:
parent
6a8537c2bf
commit
4b9bc342f5
@ -416,6 +416,7 @@ bool IsFunctionCallContext(CXCursorKind kind) {
|
|||||||
void OnIndexReference_Function(IndexFile* db,
|
void OnIndexReference_Function(IndexFile* db,
|
||||||
Range loc_spelling,
|
Range loc_spelling,
|
||||||
ClangCursor caller_cursor,
|
ClangCursor caller_cursor,
|
||||||
|
IndexFuncId called_id,
|
||||||
IndexFunc* called,
|
IndexFunc* called,
|
||||||
const std::string& called_usr,
|
const std::string& called_usr,
|
||||||
bool is_implicit) {
|
bool is_implicit) {
|
||||||
@ -423,6 +424,7 @@ void OnIndexReference_Function(IndexFile* db,
|
|||||||
IndexFuncId caller_id = db->ToFuncId(caller_cursor.cx_cursor);
|
IndexFuncId caller_id = db->ToFuncId(caller_cursor.cx_cursor);
|
||||||
IndexFunc* caller = db->Resolve(caller_id);
|
IndexFunc* caller = db->Resolve(caller_id);
|
||||||
// Calling db->ToFuncId invalidates the FuncDef* ptrs.
|
// Calling db->ToFuncId invalidates the FuncDef* ptrs.
|
||||||
|
called = db->Resolve(called_id);
|
||||||
|
|
||||||
AddFuncRef(&caller->def.callees,
|
AddFuncRef(&caller->def.callees,
|
||||||
IndexFuncRef(called->id, loc_spelling, is_implicit));
|
IndexFuncRef(called->id, loc_spelling, is_implicit));
|
||||||
@ -1056,6 +1058,7 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor,
|
|||||||
OnIndexReference_Function(data->db,
|
OnIndexReference_Function(data->db,
|
||||||
ResolveSpelling(cursor.cx_cursor),
|
ResolveSpelling(cursor.cx_cursor),
|
||||||
data->container,
|
data->container,
|
||||||
|
called_id,
|
||||||
called,
|
called,
|
||||||
ref_usr,
|
ref_usr,
|
||||||
/*implicit=*/ false);
|
/*implicit=*/ false);
|
||||||
@ -1642,6 +1645,7 @@ void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) {
|
|||||||
|
|
||||||
OnIndexReference_Function(db, loc_spelling,
|
OnIndexReference_Function(db, loc_spelling,
|
||||||
ref->container->cursor,
|
ref->container->cursor,
|
||||||
|
called_id,
|
||||||
called,
|
called,
|
||||||
ref->referencedEntity->USR, is_implicit);
|
ref->referencedEntity->USR, is_implicit);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user