diff --git a/include/IndexStoreDB/Core/Symbol.h b/include/IndexStoreDB/Core/Symbol.h index 2177aed2..706491f3 100644 --- a/include/IndexStoreDB/Core/Symbol.h +++ b/include/IndexStoreDB/Core/Symbol.h @@ -203,8 +203,6 @@ class Symbol { SymbolLanguage getLanguage() const { return SymInfo.Lang; } bool isCallable() const { return SymInfo.isCallable(); } - bool isClassLike() const { return SymInfo.isClassLike(); } - bool isClassLikeOrExtension() const { return SymInfo.isClassLikeOrExtension(); } void print(raw_ostream &OS) const; }; diff --git a/lib/Core/Symbol.cpp b/lib/Core/Symbol.cpp index 7238c7e8..79ed4b6d 100644 --- a/lib/Core/Symbol.cpp +++ b/lib/Core/Symbol.cpp @@ -33,20 +33,6 @@ bool SymbolInfo::isCallable() const { } } -bool SymbolInfo::isClassLike() const { - switch (Kind) { - case SymbolKind::Class: - case SymbolKind::Struct: - return Lang != SymbolLanguage::C; - default: - return false; - } -} - -bool SymbolInfo::isClassLikeOrExtension() const { - return isClassLike() || Kind == SymbolKind::Extension; -} - bool SymbolInfo::preferDeclarationAsCanonical() const { if (Lang == SymbolLanguage::ObjC) { return Kind == SymbolKind::Class || diff --git a/lib/Database/ImportTransaction.cpp b/lib/Database/ImportTransaction.cpp index 82bb8888..474cb6e0 100644 --- a/lib/Database/ImportTransaction.cpp +++ b/lib/Database/ImportTransaction.cpp @@ -86,7 +86,7 @@ IDCode ImportTransaction::Implementation::addSymbolInfo(IDCode provider, StringR if (symInfo.Properties.contains(SymbolProperty::UnitTest) && roles.contains(SymbolRole::Definition)) { Optional unitTestGlobalKind; - if (symInfo.isClassLikeOrExtension()) + if (symInfo.Kind == SymbolKind::Class || symInfo.Kind == SymbolKind::Extension) unitTestGlobalKind = GlobalSymbolKind::TestClassOrExtension; else if (symInfo.Kind == SymbolKind::InstanceMethod) unitTestGlobalKind = GlobalSymbolKind::TestMethod; diff --git a/lib/Index/SymbolIndex.cpp b/lib/Index/SymbolIndex.cpp index 3ee039d5..3f4d9f23 100644 --- a/lib/Index/SymbolIndex.cpp +++ b/lib/Index/SymbolIndex.cpp @@ -152,7 +152,7 @@ void SymbolIndexImpl::importSymbols(ImportTransaction &import, SymbolDataProvide std::uninitialized_copy(Name.begin(), Name.end(), copiedStr); StringRef copiedName = StringRef(copiedStr, Name.size()); // FIXME: Make this part of the compiler indexing output. E.g. a C++-like 'struct' should be a 'class' kind. - if (Info.isClassLike()) + if (Info.Kind == SymbolKind::Struct && Info.Lang == SymbolLanguage::CXX) Info.Kind = SymbolKind::Class; auto pair = CoreSymbols.insert(std::make_pair(USR, CoreSymbolData{copiedName, Info, Roles, RelatedRoles})); bool wasInserted = pair.second;