2222#include < optional>
2323
2424namespace llvm {
25- class raw_ostream ;
25+ class raw_ostream ;
2626}
2727
2828namespace 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 ;
4242
4343// / MangleContext - Context for tracking state which persists across multiple
4444// / calls to the C++ name mangler.
4545class MangleContext {
4646public:
47- enum ManglerKind {
48- MK_Itanium,
49- MK_Microsoft
50- };
47+ enum ManglerKind { MK_Itanium, MK_Microsoft };
5148
5249private:
5350 virtual void anchor ();
@@ -59,10 +56,10 @@ class MangleContext {
5956 // / ASTContext.
6057 bool IsAux = false ;
6158
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;
6663
6764public:
6865 ManglerKind getKind () const { return Kind; }
@@ -73,7 +70,7 @@ class MangleContext {
7370 ManglerKind Kind, bool IsAux = false )
7471 : Context(Context), Diags(Diags), Kind(Kind), IsAux(IsAux) {}
7572
76- virtual ~MangleContext () { }
73+ virtual ~MangleContext () {}
7774
7875 ASTContext &getASTContext () const { return Context; }
7976
@@ -82,10 +79,10 @@ class MangleContext {
8279 virtual void startNewFunction () { LocalBlockIds.clear (); }
8380
8481 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;
8784 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 ()));
8986 return Result.first ->second ;
9087 }
9188
@@ -125,7 +122,7 @@ class MangleContext {
125122 return false ;
126123 }
127124
128- virtual void needsUniqueInternalLinkageNames () { }
125+ virtual void needsUniqueInternalLinkageNames () {}
129126
130127 // FIXME: consider replacing raw_ostream & with something like SmallString &.
131128 void mangleName (GlobalDecl GD, raw_ostream &);
@@ -143,10 +140,9 @@ class MangleContext {
143140 virtual void mangleCXXRTTIName (QualType T, raw_ostream &,
144141 bool NormalizeIntegers = false ) = 0;
145142 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 &);
147144
148- void mangleGlobalBlock (const BlockDecl *BD,
149- const NamedDecl *ID,
145+ void mangleGlobalBlock (const BlockDecl *BD, const NamedDecl *ID,
150146 raw_ostream &Out);
151147 void mangleCtorBlock (const CXXConstructorDecl *CD, CXXCtorType CT,
152148 const BlockDecl *BD, raw_ostream &Out);
@@ -314,6 +310,6 @@ class ASTNameGenerator {
314310 class Implementation ;
315311 std::unique_ptr<Implementation> Impl;
316312};
317- }
313+ } // namespace clang
318314
319315#endif
0 commit comments