Clang import; Add a validation step

This commit is contained in:
Daniel Marjamäki 2020-12-29 21:36:50 +01:00
parent 0adf09c507
commit cb9efcb100
1 changed files with 6 additions and 0 deletions

View File

@ -1523,6 +1523,12 @@ void clangimport::parseClangAstDump(Tokenizer *tokenizer, std::istream &f)
if (!tree.empty())
tree[0]->createTokens1(tokenList);
// Validation
for (const Token *tok = tokenList->front(); tok; tok = tok->next()) {
if (Token::Match(tok, "(|)|[|]|{|}") && !tok->link())
throw InternalError(tok, "Token::link() is not set properly");
}
symbolDatabase->clangSetVariables(data.getVariableList());
tokenList->clangSetOrigFiles();
setTypes(tokenList);