FindModuleInstance.h 706 Bytes
Newer Older
rmrf's avatar
rmrf committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#ifndef _FIND_MODULE_INSTANCE_H_
#define _FIND_MODULE_INSTANCE_H_

#include "clang/AST/DeclCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "llvm/Support/raw_ostream.h"

namespace scpar {

using namespace clang;
using namespace std;

class FindModuleInstance : public RecursiveASTVisitor<FindModuleInstance> {
public:
  FindModuleInstance(CXXRecordDecl *, llvm::raw_ostream &);
  virtual bool VisitCXXConstructExpr(CXXConstructExpr *expr);
  virtual bool VisitFieldDecl(FieldDecl *fdecl);

  virtual ~FindModuleInstance();

  void dump();
  string getInstanceName() const;

private:
  CXXRecordDecl *declaration_;
  llvm::raw_ostream &os_;
  string instance_name_;
};
} // namespace scpar
#endif