Debian Codegraph @

clang_delta/MoveFunctionBody.h

raw symbols SCIP
1 //===----------------------------------------------------------------------===//
2 //
3 // Copyright (c) 2012 The University of Utah
4 // All rights reserved.
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See the file COPYING for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef MOVE_FUNCTION_BODY_H
12 #define MOVE_FUNCTION_BODY_H
13
14 #include <string>
15 #include "llvm/ADT/DenseMap.h"
16 #include "Transformation.h"
17
18 namespace clang {
19 class DeclGroupRef;
20 class ASTContext;
21 class FunctionDecl;
22 }
23
24 class MoveFunctionBody : public Transformation {
25
26 public:
27
28 MoveFunctionBody(const char *TransName, const char *Desc)
29 : Transformation(TransName, Desc),
30 TheFunctionDecl(NULL),
31 TheFunctionDef(NULL),
32 PrevFunctionDecl(NULL)
33 { }
34
35 ~MoveFunctionBody(void);
36
37 private:
38
39 typedef llvm::DenseMap<clang::FunctionDecl *, clang::FunctionDecl *>
40 FuncDeclToFuncDeclMap;
41
42 virtual void Initialize(clang::ASTContext &context);
43
44 virtual bool HandleTopLevelDecl(clang::DeclGroupRef D);
45
46 virtual void HandleTranslationUnit(clang::ASTContext &Ctx);
47
48 void doAnalysis(void);
49
50 void doRewriting(void);
51
52 FuncDeclToFuncDeclMap AllValidFunctionDecls;
53
54 FuncDeclToFuncDeclMap FuncDeclToFuncDef;
55
56 clang::FunctionDecl *TheFunctionDecl;
57
58 clang::FunctionDecl *TheFunctionDef;
59
60 clang::FunctionDecl *PrevFunctionDecl;
61
62 // Unimplemented
63 MoveFunctionBody(void);
64
65 MoveFunctionBody(const MoveFunctionBody &);
66
67 void operator=(const MoveFunctionBody &);
68 };
69 #endif