Debian Codegraph @

clang_delta/MoveGlobalVar.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_GLOBAL_VAR_H
12 #define MOVE_GLOBAL_VAR_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 MoveGlobalVar : public Transformation {
25
26 public:
27
28 MoveGlobalVar(const char *TransName, const char *Desc)
29 : Transformation(TransName, Desc),
30 TheFirstFunctionDecl(NULL),
31 ThePrintfDecl(NULL),
32 TheFirstDecl(NULL),
33 TheDGRPointer(NULL)
34 { }
35
36 ~MoveGlobalVar(void);
37
38 private:
39
40 virtual void Initialize(clang::ASTContext &context);
41
42 virtual bool HandleTopLevelDecl(clang::DeclGroupRef D);
43
44 virtual void HandleTranslationUnit(clang::ASTContext &Ctx);
45
46 bool isSpecialDecl(const std::string &Name);
47
48 void handleFunctionDecl(const clang::FunctionDecl *FD);
49
50 void handleOtherDecl(clang::DeclGroupRef DGR);
51
52 void liftPrintfDecl(void);
53
54 void liftOtherDecl(void);
55
56 // The first FunctionDecl which is not printf
57 const clang::FunctionDecl *TheFirstFunctionDecl;
58
59 const clang::FunctionDecl *ThePrintfDecl;
60
61 const clang::Decl *TheFirstDecl;
62
63 void *TheDGRPointer;
64
65 // Unimplemented
66 MoveGlobalVar(void);
67
68 MoveGlobalVar(const MoveGlobalVar &);
69
70 void operator=(const MoveGlobalVar &);
71 };
72 #endif