Commit d6fa4e20 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Get rid off translationUnit

parent 7edb110e
......@@ -99,7 +99,7 @@ class RewriteLogicalAndOp: public QuickFixOperation
{
public:
RewriteLogicalAndOp(Document::Ptr doc, const Snapshot &snapshot, CPPEditor *editor)
: QuickFixOperation(doc, snapshot, editor), matcher(doc->translationUnit()),
: QuickFixOperation(doc, snapshot, editor),
left(0), right(0), pattern(0)
{}
......@@ -324,7 +324,7 @@ class MoveDeclarationOutOfIfOp: public QuickFixOperation
{
public:
MoveDeclarationOutOfIfOp(Document::Ptr doc, const Snapshot &snapshot, CPPEditor *editor)
: QuickFixOperation(doc, snapshot, editor), matcher(doc->translationUnit()),
: QuickFixOperation(doc, snapshot, editor),
condition(0), pattern(0), core(0)
{}
......@@ -389,7 +389,7 @@ class MoveDeclarationOutOfWhileOp: public QuickFixOperation
{
public:
MoveDeclarationOutOfWhileOp(Document::Ptr doc, const Snapshot &snapshot, CPPEditor *editor)
: QuickFixOperation(doc, snapshot, editor), matcher(doc->translationUnit()),
: QuickFixOperation(doc, snapshot, editor),
condition(0), pattern(0), core(0)
{}
......
......@@ -33,15 +33,12 @@
using namespace CPlusPlus;
ASTMatcher::ASTMatcher(TranslationUnit *translationUnit) : _translationUnit(translationUnit)
ASTMatcher::ASTMatcher()
{ }
ASTMatcher::~ASTMatcher()
{ }
TranslationUnit *ASTMatcher::translationUnit() const
{ return _translationUnit; }
bool ASTMatcher::match(SimpleSpecifierAST *node, SimpleSpecifierAST *pattern)
{
(void) node;
......
......@@ -36,11 +36,9 @@ namespace CPlusPlus {
class CPLUSPLUS_EXPORT ASTMatcher
{
public:
ASTMatcher(TranslationUnit *translationUnit);
ASTMatcher();
virtual ~ASTMatcher();
TranslationUnit *translationUnit() const;
virtual bool match(AccessDeclarationAST *node, AccessDeclarationAST *pattern);
virtual bool match(ArrayAccessAST *node, ArrayAccessAST *pattern);
virtual bool match(ArrayDeclaratorAST *node, ArrayDeclaratorAST *pattern);
......@@ -163,9 +161,6 @@ public:
virtual bool match(ObjCDynamicPropertiesDeclarationAST *node, ObjCDynamicPropertiesDeclarationAST *pattern);
virtual bool match(ObjCFastEnumerationAST *node, ObjCFastEnumerationAST *pattern);
virtual bool match(ObjCSynchronizedStatementAST *node, ObjCSynchronizedStatementAST *pattern);
private:
TranslationUnit *_translationUnit;
};
} // end of namespace CPlusPlus
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment