Commit b5eb2157 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Minor

parent 404fa0ab
...@@ -169,19 +169,37 @@ class MyVisitor : public RecursiveASTVisitor<MyVisitor> { ...@@ -169,19 +169,37 @@ class MyVisitor : public RecursiveASTVisitor<MyVisitor> {
private: private:
ASTContext *Context; ASTContext *Context;
public: struct RefState {
explicit MyVisitor(ASTContext *Context) : Context(Context) { enum {
} UNKNOWN,
BORROWED,
virtual ~MyVisitor() { OWNED,
} type;
int num_refs;
};
struct BlockState {
DenseMap<void*, RefState> vars;
};
void handle(Stmt* stmt) {
assert(0);
} }
void checkFunction(FunctionDecl* func) { void checkFunction(FunctionDecl* func) {
//dumper()->TraverseDecl(func);
errs() << "printing:\n"; errs() << "printing:\n";
func->print(errs()); func->print(errs());
errs() << "dumping:\n"; errs() << "dumping:\n";
func->dump(errs()); func->dump(errs());
BlockState state;
handle(func->getBody());
}
public:
explicit MyVisitor(ASTContext *Context) : Context(Context) {
}
virtual ~MyVisitor() {
} }
virtual bool VisitFunctionDecl(FunctionDecl* func) { virtual bool VisitFunctionDecl(FunctionDecl* func) {
......
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