]> granicus.if.org Git - clang/commitdiff
Use raw_ostream instead of raw_svector_ostream.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 11 Feb 2011 01:41:00 +0000 (01:41 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 11 Feb 2011 01:41:00 +0000 (01:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125330 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Mangle.h
lib/AST/ItaniumMangle.cpp
lib/AST/Mangle.cpp
lib/AST/MicrosoftMangle.cpp

index a35f1d04fbc552edf454ff147bbe2a9f31ac1aeb..747a0b121a68b582370db79667955d19aaa9b4d6 100644 (file)
@@ -95,7 +95,7 @@ public:
   /// @{
 
   virtual bool shouldMangleDeclName(const NamedDecl *D) = 0;
-  virtual void mangleName(const NamedDecl *D, llvm::raw_svector_ostream &)=0;
+  virtual void mangleName(const NamedDecl *D, llvm::raw_ostream &)=0;
   virtual void mangleThunk(const CXXMethodDecl *MD,
                           const ThunkInfo &Thunk,
                           llvm::SmallVectorImpl<char> &) = 0;
@@ -114,20 +114,20 @@ public:
   virtual void mangleCXXRTTI(QualType T, llvm::SmallVectorImpl<char> &) = 0;
   virtual void mangleCXXRTTIName(QualType T, llvm::SmallVectorImpl<char> &) = 0;
   virtual void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type,
-                             llvm::raw_svector_ostream &) = 0;
+                             llvm::raw_ostream &) = 0;
   virtual void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type,
-                             llvm::raw_svector_ostream &) = 0;
+                             llvm::raw_ostream &) = 0;
 
   void mangleGlobalBlock(const BlockDecl *BD,
-                         llvm::raw_svector_ostream &Out);
+                         llvm::raw_ostream &Out);
   void mangleCtorBlock(const CXXConstructorDecl *CD, CXXCtorType CT,
-                       const BlockDecl *BD, llvm::raw_svector_ostream &Out);
+                       const BlockDecl *BD, llvm::raw_ostream &Out);
   void mangleDtorBlock(const CXXDestructorDecl *CD, CXXDtorType DT,
-                       const BlockDecl *BD, llvm::raw_svector_ostream &Out);
+                       const BlockDecl *BD, llvm::raw_ostream &Out);
   void mangleBlock(const DeclContext *DC, const BlockDecl *BD,
-                   llvm::raw_svector_ostream &Out);
+                   llvm::raw_ostream &Out);
   // Do the right thing.
-  void mangleBlock(const BlockDecl *BD, llvm::raw_svector_ostream &Out);
+  void mangleBlock(const BlockDecl *BD, llvm::raw_ostream &Out);
 
   void mangleObjCMethodName(const ObjCMethodDecl *MD,
                             llvm::SmallVectorImpl<char> &);
index 1a3bf659c30168a1f879a1204dc530c99389f266..6205988c9174892c18fdea1b0b838cae9225338c 100644 (file)
@@ -91,7 +91,7 @@ public:
   /// @{
 
   bool shouldMangleDeclName(const NamedDecl *D);
-  void mangleName(const NamedDecl *D, llvm::raw_svector_ostream &);
+  void mangleName(const NamedDecl *D, llvm::raw_ostream &);
   void mangleThunk(const CXXMethodDecl *MD,
                    const ThunkInfo &Thunk,
                    llvm::SmallVectorImpl<char> &);
@@ -110,9 +110,9 @@ public:
   void mangleCXXRTTI(QualType T, llvm::SmallVectorImpl<char> &);
   void mangleCXXRTTIName(QualType T, llvm::SmallVectorImpl<char> &);
   void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type,
-                     llvm::raw_svector_ostream &);
+                     llvm::raw_ostream &);
   void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type,
-                     llvm::raw_svector_ostream &);
+                     llvm::raw_ostream &);
 
   void mangleItaniumGuardVariable(const VarDecl *D,
                                   llvm::SmallVectorImpl<char> &);
@@ -136,7 +136,7 @@ public:
 /// CXXNameMangler - Manage the mangling of a single name.
 class CXXNameMangler {
   ItaniumMangleContext &Context;
-  llvm::raw_svector_ostream &Out;
+  llvm::raw_ostream &Out;
 
   const CXXMethodDecl *Structor;
   unsigned StructorType;
@@ -149,13 +149,13 @@ class CXXNameMangler {
   ASTContext &getASTContext() const { return Context.getASTContext(); }
 
 public:
-  CXXNameMangler(ItaniumMangleContext &C, llvm::raw_svector_ostream &Out_)
+  CXXNameMangler(ItaniumMangleContext &C, llvm::raw_ostream &Out_)
     : Context(C), Out(Out_), Structor(0), StructorType(0), SeqID(0) { }
-  CXXNameMangler(ItaniumMangleContext &C, llvm::raw_svector_ostream &Out_,
+  CXXNameMangler(ItaniumMangleContext &C, llvm::raw_ostream &Out_,
                  const CXXConstructorDecl *D, CXXCtorType Type)
     : Context(C), Out(Out_), Structor(getStructor(D)), StructorType(Type),
     SeqID(0) { }
-  CXXNameMangler(ItaniumMangleContext &C, llvm::raw_svector_ostream &Out_,
+  CXXNameMangler(ItaniumMangleContext &C, llvm::raw_ostream &Out_,
                  const CXXDestructorDecl *D, CXXDtorType Type)
     : Context(C), Out(Out_), Structor(getStructor(D)), StructorType(Type),
     SeqID(0) { }
@@ -171,7 +171,7 @@ public:
     free(result);
   }
 #endif
-  llvm::raw_svector_ostream &getStream() { return Out; }
+  llvm::raw_ostream &getStream() { return Out; }
 
   void mangle(const NamedDecl *D, llvm::StringRef Prefix = "_Z");
   void mangleCallOffset(int64_t NonVirtual, int64_t Virtual);
@@ -2537,7 +2537,7 @@ void CXXNameMangler::addSubstitution(uintptr_t Ptr) {
 /// emit the identifier of the declaration (\c D->getIdentifier()) as its
 /// name.
 void ItaniumMangleContext::mangleName(const NamedDecl *D,
-                                      llvm::raw_svector_ostream &Out) {
+                                      llvm::raw_ostream &Out) {
   assert((isa<FunctionDecl>(D) || isa<VarDecl>(D)) &&
           "Invalid mangleName() call, argument is not a variable or function!");
   assert(!isa<CXXConstructorDecl>(D) && !isa<CXXDestructorDecl>(D) &&
@@ -2553,14 +2553,14 @@ void ItaniumMangleContext::mangleName(const NamedDecl *D,
 
 void ItaniumMangleContext::mangleCXXCtor(const CXXConstructorDecl *D,
                                          CXXCtorType Type,
-                                         llvm::raw_svector_ostream &Out) {
+                                         llvm::raw_ostream &Out) {
   CXXNameMangler Mangler(*this, Out, D, Type);
   Mangler.mangle(D);
 }
 
 void ItaniumMangleContext::mangleCXXDtor(const CXXDestructorDecl *D,
                                          CXXDtorType Type,
-                                         llvm::raw_svector_ostream &Out) {
+                                         llvm::raw_ostream &Out) {
   CXXNameMangler Mangler(*this, Out, D, Type);
   Mangler.mangle(D);
 }
index 51d4be340fbad1d35d1b6fdb9fccc98bb6ef4bf2..a84c2a6f6aebcee5728dc61f067833da9b35e447 100644 (file)
@@ -39,7 +39,7 @@ namespace {
 static void mangleFunctionBlock(MangleContext &Context,
                                 llvm::StringRef Outer,
                                 const BlockDecl *BD,
-                                llvm::raw_svector_ostream &Out) {
+                                llvm::raw_ostream &Out) {
   Out << "__" << Outer << "_block_invoke_" << Context.getBlockId(BD, true);
 }
 
@@ -55,13 +55,13 @@ static void checkMangleDC(const DeclContext *DC, const BlockDecl *BD) {
 }
 
 void MangleContext::mangleGlobalBlock(const BlockDecl *BD,
-                                      llvm::raw_svector_ostream &Out) {
+                                      llvm::raw_ostream &Out) {
   Out << "__block_global_" << getBlockId(BD, false);
 }
 
 void MangleContext::mangleCtorBlock(const CXXConstructorDecl *CD,
                                     CXXCtorType CT, const BlockDecl *BD,
-                                    llvm::raw_svector_ostream &ResStream) {
+                                    llvm::raw_ostream &ResStream) {
   checkMangleDC(CD, BD);
   llvm::SmallString<64> Buffer;
   llvm::raw_svector_ostream Out(Buffer);
@@ -72,7 +72,7 @@ void MangleContext::mangleCtorBlock(const CXXConstructorDecl *CD,
 
 void MangleContext::mangleDtorBlock(const CXXDestructorDecl *DD,
                                     CXXDtorType DT, const BlockDecl *BD,
-                                    llvm::raw_svector_ostream &ResStream) {
+                                    llvm::raw_ostream &ResStream) {
   checkMangleDC(DD, BD);
   llvm::SmallString<64> Buffer;
   llvm::raw_svector_ostream Out(Buffer);
@@ -82,7 +82,7 @@ void MangleContext::mangleDtorBlock(const CXXDestructorDecl *DD,
 }
 
 void MangleContext::mangleBlock(const DeclContext *DC, const BlockDecl *BD,
-                                llvm::raw_svector_ostream &Out) {
+                                llvm::raw_ostream &Out) {
   assert(!isa<CXXConstructorDecl>(DC) && !isa<CXXDestructorDecl>(DC));
   checkMangleDC(DC, BD);
 
@@ -124,7 +124,7 @@ void MangleContext::mangleObjCMethodName(const ObjCMethodDecl *MD,
 }
 
 void MangleContext::mangleBlock(const BlockDecl *BD,
-                                llvm::raw_svector_ostream &Out) {
+                                llvm::raw_ostream &Out) {
   const DeclContext *DC = BD->getDeclContext();
   while (isa<BlockDecl>(DC) || isa<EnumDecl>(DC))
     DC = DC->getParent();
index a2300eef23819226ae13f81ce13776aa6eda19ef..7f477e5a2f0d46ed4f052fa70eec8d8dd572bd4c 100644 (file)
@@ -29,12 +29,12 @@ namespace {
 /// Microsoft Visual C++ ABI.
 class MicrosoftCXXNameMangler {
   MangleContext &Context;
-  llvm::raw_svector_ostream &Out;
+  llvm::raw_ostream &Out;
 
   ASTContext &getASTContext() const { return Context.getASTContext(); }
 
 public:
-  MicrosoftCXXNameMangler(MangleContext &C, llvm::raw_svector_ostream &Out_)
+  MicrosoftCXXNameMangler(MangleContext &C, llvm::raw_ostream &Out_)
   : Context(C), Out(Out_) { }
 
   void mangle(const NamedDecl *D, llvm::StringRef Prefix = "?");
@@ -80,7 +80,7 @@ public:
   MicrosoftMangleContext(ASTContext &Context,
                          Diagnostic &Diags) : MangleContext(Context, Diags) { }
   virtual bool shouldMangleDeclName(const NamedDecl *D);
-  virtual void mangleName(const NamedDecl *D, llvm::raw_svector_ostream &Out);
+  virtual void mangleName(const NamedDecl *D, llvm::raw_ostream &Out);
   virtual void mangleThunk(const CXXMethodDecl *MD,
                            const ThunkInfo &Thunk,
                            llvm::SmallVectorImpl<char> &);
@@ -97,9 +97,9 @@ public:
   virtual void mangleCXXRTTI(QualType T, llvm::SmallVectorImpl<char> &);
   virtual void mangleCXXRTTIName(QualType T, llvm::SmallVectorImpl<char> &);
   virtual void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type,
-                             llvm::raw_svector_ostream &);
+                             llvm::raw_ostream &);
   virtual void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type,
-                             llvm::raw_svector_ostream &);
+                             llvm::raw_ostream &);
   virtual void mangleReferenceTemporary(const clang::VarDecl *,
                                         llvm::SmallVectorImpl<char> &);
 };
@@ -1122,7 +1122,7 @@ void MicrosoftCXXNameMangler::mangleType(const DecltypeType *T) {
 }
 
 void MicrosoftMangleContext::mangleName(const NamedDecl *D,
-                                        llvm::raw_svector_ostream &Out) {
+                                        llvm::raw_ostream &Out) {
   assert((isa<FunctionDecl>(D) || isa<VarDecl>(D)) &&
          "Invalid mangleName() call, argument is not a variable or function!");
   assert(!isa<CXXConstructorDecl>(D) && !isa<CXXDestructorDecl>(D) &&
@@ -1170,12 +1170,12 @@ void MicrosoftMangleContext::mangleCXXRTTIName(QualType T,
 }
 void MicrosoftMangleContext::mangleCXXCtor(const CXXConstructorDecl *D,
                                            CXXCtorType Type,
-                                           llvm::raw_svector_ostream &) {
+                                           llvm::raw_ostream &) {
   assert(false && "Can't yet mangle constructors!");
 }
 void MicrosoftMangleContext::mangleCXXDtor(const CXXDestructorDecl *D,
                                            CXXDtorType Type,
-                                           llvm::raw_svector_ostream &) {
+                                           llvm::raw_ostream &) {
   assert(false && "Can't yet mangle destructors!");
 }
 void MicrosoftMangleContext::mangleReferenceTemporary(const clang::VarDecl *,