Clang import; Type fixes

This commit is contained in:
Daniel Marjamäki 2020-01-11 18:39:59 +01:00
parent abc51afcf1
commit cde757bcd3
1 changed files with 4 additions and 1 deletions

View File

@ -144,6 +144,7 @@ namespace clangimport {
mDeclMap.insert(std::pair<std::string, Decl>(addr, decl)); mDeclMap.insert(std::pair<std::string, Decl>(addr, decl));
def->varId(++mVarId); def->varId(++mVarId);
def->variable(var); def->variable(var);
if (def->valueType())
var->setValueType(*def->valueType()); var->setValueType(*def->valueType());
notFound(addr); notFound(addr);
} }
@ -386,6 +387,8 @@ void clangimport::AstNode::setValueType(Token *tok)
TokenList decl(nullptr); TokenList decl(nullptr);
addTypeTokens(&decl, type); addTypeTokens(&decl, type);
if (!decl.front())
return;
ValueType valueType = ValueType::parseDecl(decl.front(), mData->mSettings); ValueType valueType = ValueType::parseDecl(decl.front(), mData->mSettings);
if (valueType.type != ValueType::Type::UNKNOWN_TYPE) if (valueType.type != ValueType::Type::UNKNOWN_TYPE)