src: updated SymbolKind enum

* removed SymbolKinds for Parameter and LocalSymbol, because these are not stored as symbols inside the database
* added Module symbol kind for Python
This commit is contained in:
mlangkabel
2018-12-10 16:26:38 +01:00
parent 6d5937d18f
commit 21d947ed6c
17 changed files with 90 additions and 58 deletions
+15 -9
View File
@@ -85,15 +85,25 @@ SymbolKind utility::convertTagKind(const clang::TagTypeKind tagKind)
}
}
bool utility::isLocalVariable(const clang::VarDecl* d)
{
if (!llvm::isa<clang::ParmVarDecl>(d) && !(d->getParentFunctionOrMethod() == nullptr))
{
return true;
}
return false;
}
bool utility::isParameter(const clang::VarDecl* d)
{
return llvm::isa<clang::ParmVarDecl>(d);
}
SymbolKind utility::getSymbolKind(const clang::VarDecl* d)
{
SymbolKind symbolKind = SYMBOL_KIND_MAX;
if (llvm::isa<clang::ParmVarDecl>(d))
{
symbolKind = SYMBOL_PARAMETER;
}
else if (d->getParentFunctionOrMethod() == nullptr)
if (d->getParentFunctionOrMethod() == nullptr)
{
if (d->getAccess() == clang::AS_none)
{
@@ -104,10 +114,6 @@ SymbolKind utility::getSymbolKind(const clang::VarDecl* d)
symbolKind = SYMBOL_FIELD;
}
}
else
{
symbolKind = SYMBOL_LOCAL_VARIABLE;
}
return symbolKind;
}