forked from vgvassilev/creduce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RemoveUnusedEnumMember.h
56 lines (40 loc) · 1.44 KB
/
RemoveUnusedEnumMember.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//===----------------------------------------------------------------------===//
//
// Copyright (c) 2012 The University of Utah
// Copyright (c) 2012 Konstantin Tokarev <[email protected]>
// All rights reserved.
//
// This file is distributed under the University of Illinois Open Source
// License. See the file COPYING for details.
//
//===----------------------------------------------------------------------===//
#ifndef REMOVE_UNUSED_VAR_H
#define REMOVE_UNUSED_VAR_H
#include <string>
#include "llvm/ADT/DenseMap.h"
#include "clang/AST/Decl.h"
#include "Transformation.h"
class RemoveUnusedEnumMemberAnalysisVisitor;
class RemoveUnusedEnumMember : public Transformation {
friend class RemoveUnusedEnumMemberAnalysisVisitor;
public:
RemoveUnusedEnumMember(const char *TransName, const char *Desc)
: Transformation(TransName, Desc),
AnalysisVisitor(0),
TheEnumDecl(0)
{ }
~RemoveUnusedEnumMember();
private:
virtual void Initialize(clang::ASTContext &context);
virtual void HandleTranslationUnit(clang::ASTContext &Ctx);
void removeEnumConstantDecl();
RemoveUnusedEnumMemberAnalysisVisitor *AnalysisVisitor;
clang::EnumDecl *TheEnumDecl;
clang::EnumDecl::enumerator_iterator TheEnumIterator;
clang::EnumDecl::enumerator_iterator TheEnumIteratorPrevious;
// Unimplemented
RemoveUnusedEnumMember();
RemoveUnusedEnumMember(const RemoveUnusedEnumMember &);
void operator=(const RemoveUnusedEnumMember &);
};
#endif