22
22
#include < optional>
23
23
24
24
namespace llvm {
25
- class raw_ostream ;
25
+ class raw_ostream ;
26
26
}
27
27
28
28
namespace clang {
29
- class ASTContext ;
30
- class BlockDecl ;
31
- class CXXConstructorDecl ;
32
- class CXXDestructorDecl ;
33
- class CXXMethodDecl ;
34
- class FunctionDecl ;
35
- struct MethodVFTableLocation ;
36
- class NamedDecl ;
37
- class ObjCMethodDecl ;
38
- class StringLiteral ;
39
- struct ThisAdjustment ;
40
- struct ThunkInfo ;
41
- class VarDecl ;
29
+ class ASTContext ;
30
+ class BlockDecl ;
31
+ class CXXConstructorDecl ;
32
+ class CXXDestructorDecl ;
33
+ class CXXMethodDecl ;
34
+ class FunctionDecl ;
35
+ struct MethodVFTableLocation ;
36
+ class NamedDecl ;
37
+ class ObjCMethodDecl ;
38
+ class StringLiteral ;
39
+ struct ThisAdjustment ;
40
+ struct ThunkInfo ;
41
+ class VarDecl ;
42
42
43
43
// / MangleContext - Context for tracking state which persists across multiple
44
44
// / calls to the C++ name mangler.
45
45
class MangleContext {
46
46
public:
47
- enum ManglerKind {
48
- MK_Itanium,
49
- MK_Microsoft
50
- };
47
+ enum ManglerKind { MK_Itanium, MK_Microsoft };
51
48
52
49
private:
53
50
virtual void anchor ();
@@ -59,10 +56,10 @@ class MangleContext {
59
56
// / ASTContext.
60
57
bool IsAux = false ;
61
58
62
- llvm::DenseMap<const BlockDecl*, unsigned > GlobalBlockIds;
63
- llvm::DenseMap<const BlockDecl*, unsigned > LocalBlockIds;
64
- llvm::DenseMap<const NamedDecl*, uint64_t > AnonStructIds;
65
- llvm::DenseMap<const FunctionDecl*, unsigned > FuncAnonStructSize;
59
+ llvm::DenseMap<const BlockDecl *, unsigned > GlobalBlockIds;
60
+ llvm::DenseMap<const BlockDecl *, unsigned > LocalBlockIds;
61
+ llvm::DenseMap<const NamedDecl *, uint64_t > AnonStructIds;
62
+ llvm::DenseMap<const FunctionDecl *, unsigned > FuncAnonStructSize;
66
63
67
64
public:
68
65
ManglerKind getKind () const { return Kind; }
@@ -73,7 +70,7 @@ class MangleContext {
73
70
ManglerKind Kind, bool IsAux = false )
74
71
: Context(Context), Diags(Diags), Kind(Kind), IsAux(IsAux) {}
75
72
76
- virtual ~MangleContext () { }
73
+ virtual ~MangleContext () {}
77
74
78
75
ASTContext &getASTContext () const { return Context; }
79
76
@@ -82,10 +79,10 @@ class MangleContext {
82
79
virtual void startNewFunction () { LocalBlockIds.clear (); }
83
80
84
81
unsigned getBlockId (const BlockDecl *BD, bool Local) {
85
- llvm::DenseMap<const BlockDecl *, unsigned > &BlockIds
86
- = Local? LocalBlockIds : GlobalBlockIds;
82
+ llvm::DenseMap<const BlockDecl *, unsigned > &BlockIds =
83
+ Local ? LocalBlockIds : GlobalBlockIds;
87
84
std::pair<llvm::DenseMap<const BlockDecl *, unsigned >::iterator, bool >
88
- Result = BlockIds.insert (std::make_pair (BD, BlockIds.size ()));
85
+ Result = BlockIds.insert (std::make_pair (BD, BlockIds.size ()));
89
86
return Result.first ->second ;
90
87
}
91
88
@@ -125,7 +122,7 @@ class MangleContext {
125
122
return false ;
126
123
}
127
124
128
- virtual void needsUniqueInternalLinkageNames () { }
125
+ virtual void needsUniqueInternalLinkageNames () {}
129
126
130
127
// FIXME: consider replacing raw_ostream & with something like SmallString &.
131
128
void mangleName (GlobalDecl GD, raw_ostream &);
@@ -143,10 +140,9 @@ class MangleContext {
143
140
virtual void mangleCXXRTTIName (QualType T, raw_ostream &,
144
141
bool NormalizeIntegers = false ) = 0;
145
142
virtual void mangleStringLiteral (const StringLiteral *SL, raw_ostream &) = 0;
146
- virtual void mangleMSGuidDecl (const MSGuidDecl *GD, raw_ostream&);
143
+ virtual void mangleMSGuidDecl (const MSGuidDecl *GD, raw_ostream &);
147
144
148
- void mangleGlobalBlock (const BlockDecl *BD,
149
- const NamedDecl *ID,
145
+ void mangleGlobalBlock (const BlockDecl *BD, const NamedDecl *ID,
150
146
raw_ostream &Out);
151
147
void mangleCtorBlock (const CXXConstructorDecl *CD, CXXCtorType CT,
152
148
const BlockDecl *BD, raw_ostream &Out);
@@ -314,6 +310,6 @@ class ASTNameGenerator {
314
310
class Implementation ;
315
311
std::unique_ptr<Implementation> Impl;
316
312
};
317
- }
313
+ } // namespace clang
318
314
319
315
#endif
0 commit comments