@@ -23,8 +23,8 @@ namespace llvm {
2323class IfDefEmitter {
2424public:
2525 IfDefEmitter (raw_ostream &OS, const Twine &Name) : Name(Name.str()), OS(OS) {
26- OS << " #ifdef " << Name << " \n "
27- << " #undef " << Name << " \n\n " ;
26+ OS << " #ifdef " << this -> Name << " \n "
27+ << " #undef " << this -> Name << " \n\n " ;
2828 }
2929 ~IfDefEmitter () { OS << " \n #endif // " << Name << " \n\n " ; }
3030
@@ -38,8 +38,8 @@ class IncludeGuardEmitter {
3838public:
3939 IncludeGuardEmitter (raw_ostream &OS, const Twine &Name)
4040 : Name(Name.str()), OS(OS) {
41- OS << " #ifndef " << Name << " \n "
42- << " #define " << Name << " \n\n " ;
41+ OS << " #ifndef " << this -> Name << " \n "
42+ << " #define " << this -> Name << " \n\n " ;
4343 }
4444 ~IncludeGuardEmitter () { OS << " \n #endif // " << Name << " \n " ; }
4545
@@ -53,10 +53,10 @@ class IncludeGuardEmitter {
5353// namespace scope.
5454class NamespaceEmitter {
5555public:
56- NamespaceEmitter (raw_ostream &OS, const Twine &NameUntrimmed )
57- : Name(trim(NameUntrimmed )), OS(OS) {
58- if (!Name.empty ())
59- OS << " namespace " << Name << " {\n " ;
56+ NamespaceEmitter (raw_ostream &OS, const Twine &Name )
57+ : Name(trim(Name.str() )), OS(OS) {
58+ if (!this -> Name .empty ())
59+ OS << " namespace " << this -> Name << " {\n " ;
6060 }
6161
6262 ~NamespaceEmitter () { close (); }
@@ -76,8 +76,7 @@ class NamespaceEmitter {
7676 // }
7777 //
7878 // and cannot use "namespace ::mlir::toy".
79- static std::string trim (const Twine &NameUntrimmed) {
80- std::string Name = NameUntrimmed.str ();
79+ static std::string trim (std::string Name) {
8180 StringRef StrRef = Name;
8281 StrRef.consume_front (" ::" );
8382 return StrRef.str ();
0 commit comments