|
20 | 20 |
|
21 | 21 | #include "errortypes.h" |
22 | 22 | #include "mathlib.h" |
23 | | -#include "nonnullptr.h" |
| 23 | +#include "refthunk.h" |
24 | 24 | #include "standards.h" |
25 | 25 | #include "symboldatabase.h" |
26 | 26 | #include "token.h" |
@@ -234,8 +234,8 @@ namespace clangimport { |
234 | 234 | , mSymbolDatabase(symbolDatabase) |
235 | 235 | {} |
236 | 236 |
|
237 | | - NonNullPtr<const Settings> mSettings; |
238 | | - NonNullPtr<SymbolDatabase> mSymbolDatabase; |
| 237 | + RefThunk<const Settings> mSettings; |
| 238 | + RefThunk<SymbolDatabase> mSymbolDatabase; |
239 | 239 |
|
240 | 240 | int enumValue = 0; |
241 | 241 |
|
@@ -644,7 +644,7 @@ const ::Type * clangimport::AstNode::addTypeTokens(TokenList &tokenList, const s |
644 | 644 | for (const Token *typeToken = tokenList.back(); Token::Match(typeToken, "&|*|%name%"); typeToken = typeToken->previous()) { |
645 | 645 | if (!typeToken->isName()) |
646 | 646 | continue; |
647 | | - const ::Type *recordType = scope->symdb->findVariableType(scope, typeToken); |
| 647 | + const ::Type *recordType = scope->symdb().findVariableType(scope, typeToken); |
648 | 648 | if (recordType) { |
649 | 649 | const_cast<Token*>(typeToken)->type(recordType); |
650 | 650 | return recordType; |
@@ -673,7 +673,7 @@ void clangimport::AstNode::addFullScopeNameTokens(TokenList &tokenList, const Sc |
673 | 673 | const Scope *clangimport::AstNode::getNestedInScope(TokenList &tokenList) |
674 | 674 | { |
675 | 675 | if (!tokenList.back()) |
676 | | - return &mData->mSymbolDatabase->scopeList.front(); |
| 676 | + return &mData->mSymbolDatabase().scopeList.front(); |
677 | 677 | if (tokenList.back()->str() == "}" && mData->mNotScope.find(tokenList.back()) == mData->mNotScope.end()) |
678 | 678 | return tokenList.back()->scope()->nestedIn; |
679 | 679 | return tokenList.back()->scope(); |
@@ -1072,8 +1072,8 @@ Token *clangimport::AstNode::createTokens(TokenList &tokenList) |
1072 | 1072 | const_cast<Token *>(enumscope->bodyEnd)->deletePrevious(); |
1073 | 1073 |
|
1074 | 1074 | // Create enum type |
1075 | | - mData->mSymbolDatabase->typeList.emplace_back(enumtok, enumscope, enumtok->scope()); |
1076 | | - enumscope->definedType = &mData->mSymbolDatabase->typeList.back(); |
| 1075 | + mData->mSymbolDatabase().typeList.emplace_back(enumtok, enumscope, enumtok->scope()); |
| 1076 | + enumscope->definedType = &mData->mSymbolDatabase().typeList.back(); |
1077 | 1077 | if (nametok) |
1078 | 1078 | const_cast<Scope *>(enumtok->scope())->definedTypesMap[nametok->str()] = enumscope->definedType; |
1079 | 1079 |
|
@@ -1239,8 +1239,8 @@ Token *clangimport::AstNode::createTokens(TokenList &tokenList) |
1239 | 1239 | } |
1240 | 1240 |
|
1241 | 1241 | Scope *recordScope = createScope(tokenList, ScopeType::eStruct, children, classDef); |
1242 | | - mData->mSymbolDatabase->typeList.emplace_back(classDef, recordScope, classDef->scope()); |
1243 | | - recordScope->definedType = &mData->mSymbolDatabase->typeList.back(); |
| 1242 | + mData->mSymbolDatabase().typeList.emplace_back(classDef, recordScope, classDef->scope()); |
| 1243 | + recordScope->definedType = &mData->mSymbolDatabase().typeList.back(); |
1244 | 1244 | if (!recordName.empty()) { |
1245 | 1245 | recordScope->className = recordName; |
1246 | 1246 | const_cast<Scope *>(classDef->scope())->definedTypesMap[recordName] = recordScope->definedType; |
@@ -1521,8 +1521,8 @@ void clangimport::AstNode::createTokensForCXXRecord(TokenList &tokenList) |
1521 | 1521 | const std::string addr = mExtTokens[0]; |
1522 | 1522 | mData->scopeDecl(addr, scope); |
1523 | 1523 | scope->className = className; |
1524 | | - mData->mSymbolDatabase->typeList.emplace_back(classToken, scope, classToken->scope()); |
1525 | | - scope->definedType = &mData->mSymbolDatabase->typeList.back(); |
| 1524 | + mData->mSymbolDatabase().typeList.emplace_back(classToken, scope, classToken->scope()); |
| 1525 | + scope->definedType = &mData->mSymbolDatabase().typeList.back(); |
1526 | 1526 | const_cast<Scope *>(classToken->scope())->definedTypesMap[className] = scope->definedType; |
1527 | 1527 | } |
1528 | 1528 | addtoken(tokenList, ";"); |
|
0 commit comments