forked from qt-creator/qt-creator
Refactored the AST visitors.
Now, the ASTVisitor constructor takes a valid reference to a TranslationUnit.
This commit is contained in:
@@ -32,8 +32,8 @@
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
ASTParent::ASTParent(Control *control, AST *rootNode)
|
||||
: ASTVisitor(control)
|
||||
ASTParent::ASTParent(TranslationUnit *translationUnit, AST *rootNode)
|
||||
: ASTVisitor(translationUnit)
|
||||
{
|
||||
accept(rootNode);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CPlusPlus {
|
||||
class CPLUSPLUS_EXPORT ASTParent: protected ASTVisitor
|
||||
{
|
||||
public:
|
||||
ASTParent(Control *control, AST *rootNode);
|
||||
ASTParent(TranslationUnit *transaltionUnit, AST *rootNode);
|
||||
virtual ~ASTParent();
|
||||
|
||||
AST *operator()(AST *ast) const;
|
||||
|
||||
@@ -41,7 +41,7 @@ using namespace CPlusPlus;
|
||||
|
||||
|
||||
CheckUndefinedSymbols::CheckUndefinedSymbols(Document::Ptr doc)
|
||||
: ASTVisitor(doc->control()), _doc(doc)
|
||||
: ASTVisitor(doc->translationUnit()), _doc(doc)
|
||||
{ }
|
||||
|
||||
CheckUndefinedSymbols::~CheckUndefinedSymbols()
|
||||
|
||||
@@ -404,7 +404,7 @@ void Document::check(CheckMode mode)
|
||||
if (! isParsed())
|
||||
parse();
|
||||
|
||||
Semantic semantic(_control);
|
||||
Semantic semantic(_translationUnit);
|
||||
if (mode == FastCheck)
|
||||
semantic.setSkipFunctionBodies(true);
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@
|
||||
using namespace CPlusPlus;
|
||||
|
||||
FindUsages::FindUsages(Document::Ptr doc, const Snapshot &snapshot, QFutureInterface<Usage> *future)
|
||||
: ASTVisitor(doc->control()),
|
||||
: ASTVisitor(doc->translationUnit()),
|
||||
_future(future),
|
||||
_doc(doc),
|
||||
_snapshot(snapshot),
|
||||
_source(_doc->source()),
|
||||
_sem(doc->control()),
|
||||
_sem(doc->translationUnit()),
|
||||
_inSimpleDeclaration(0)
|
||||
{
|
||||
_snapshot.insert(_doc);
|
||||
|
||||
@@ -72,9 +72,9 @@ static QList<_Tp> removeDuplicates(const QList<_Tp> &results)
|
||||
// ResolveExpression
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
ResolveExpression::ResolveExpression(const LookupContext &context)
|
||||
: ASTVisitor(context.expressionDocument()->control()),
|
||||
: ASTVisitor(context.expressionDocument()->translationUnit()),
|
||||
_context(context),
|
||||
sem(_context.control())
|
||||
sem(context.expressionDocument()->translationUnit())
|
||||
{ }
|
||||
|
||||
ResolveExpression::~ResolveExpression()
|
||||
|
||||
Reference in New Issue
Block a user