forked from OSchip/llvm-project
Don't try to parse ObjC method if CU isn't ObjC
Improve manual indexing performance when indexing non objective C code. Differential Revision: https://reviews.llvm.org/D63171 llvm-svn: 363441
This commit is contained in:
parent
2b9f6caa71
commit
6df47ef22b
|
@ -249,26 +249,30 @@ void ManualDWARFIndex::IndexUnitImpl(
|
||||||
case DW_TAG_subprogram:
|
case DW_TAG_subprogram:
|
||||||
if (has_address) {
|
if (has_address) {
|
||||||
if (name) {
|
if (name) {
|
||||||
ObjCLanguage::MethodName objc_method(name, true);
|
bool is_objc_method = false;
|
||||||
if (objc_method.IsValid(true)) {
|
if (cu_language == eLanguageTypeObjC ||
|
||||||
ConstString objc_class_name_with_category(
|
cu_language == eLanguageTypeObjC_plus_plus) {
|
||||||
objc_method.GetClassNameWithCategory());
|
ObjCLanguage::MethodName objc_method(name, true);
|
||||||
ConstString objc_selector_name(objc_method.GetSelector());
|
if (objc_method.IsValid(true)) {
|
||||||
ConstString objc_fullname_no_category_name(
|
is_objc_method = true;
|
||||||
objc_method.GetFullNameWithoutCategory(true));
|
ConstString class_name_with_category(
|
||||||
ConstString objc_class_name_no_category(objc_method.GetClassName());
|
objc_method.GetClassNameWithCategory());
|
||||||
set.function_fullnames.Insert(ConstString(name), ref);
|
ConstString objc_selector_name(objc_method.GetSelector());
|
||||||
if (objc_class_name_with_category)
|
ConstString objc_fullname_no_category_name(
|
||||||
set.objc_class_selectors.Insert(objc_class_name_with_category,
|
objc_method.GetFullNameWithoutCategory(true));
|
||||||
|
ConstString class_name_no_category(objc_method.GetClassName());
|
||||||
|
set.function_fullnames.Insert(ConstString(name), ref);
|
||||||
|
if (class_name_with_category)
|
||||||
|
set.objc_class_selectors.Insert(class_name_with_category, ref);
|
||||||
|
if (class_name_no_category &&
|
||||||
|
class_name_no_category != class_name_with_category)
|
||||||
|
set.objc_class_selectors.Insert(class_name_no_category, ref);
|
||||||
|
if (objc_selector_name)
|
||||||
|
set.function_selectors.Insert(objc_selector_name, ref);
|
||||||
|
if (objc_fullname_no_category_name)
|
||||||
|
set.function_fullnames.Insert(objc_fullname_no_category_name,
|
||||||
ref);
|
ref);
|
||||||
if (objc_class_name_no_category &&
|
}
|
||||||
objc_class_name_no_category != objc_class_name_with_category)
|
|
||||||
set.objc_class_selectors.Insert(objc_class_name_no_category, ref);
|
|
||||||
if (objc_selector_name)
|
|
||||||
set.function_selectors.Insert(objc_selector_name, ref);
|
|
||||||
if (objc_fullname_no_category_name)
|
|
||||||
set.function_fullnames.Insert(objc_fullname_no_category_name,
|
|
||||||
ref);
|
|
||||||
}
|
}
|
||||||
// If we have a mangled name, then the DW_AT_name attribute is
|
// If we have a mangled name, then the DW_AT_name attribute is
|
||||||
// usually the method name without the class or any parameters
|
// usually the method name without the class or any parameters
|
||||||
|
@ -279,7 +283,7 @@ void ManualDWARFIndex::IndexUnitImpl(
|
||||||
else
|
else
|
||||||
set.function_basenames.Insert(ConstString(name), ref);
|
set.function_basenames.Insert(ConstString(name), ref);
|
||||||
|
|
||||||
if (!is_method && !mangled_cstr && !objc_method.IsValid(true))
|
if (!is_method && !mangled_cstr && !is_objc_method)
|
||||||
set.function_fullnames.Insert(ConstString(name), ref);
|
set.function_fullnames.Insert(ConstString(name), ref);
|
||||||
}
|
}
|
||||||
if (mangled_cstr) {
|
if (mangled_cstr) {
|
||||||
|
|
Loading…
Reference in New Issue