diff options
Diffstat (limited to 'lib/Transforms/Instrumentation/DebugIR.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/DebugIR.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/Instrumentation/DebugIR.cpp b/lib/Transforms/Instrumentation/DebugIR.cpp index 56e60e6984..f2f1738808 100644 --- a/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/lib/Transforms/Instrumentation/DebugIR.cpp @@ -352,12 +352,14 @@ private: } std::string getTypeName(Type *T) { - string_ostream OS; + std::string TypeName; + raw_string_ostream TypeStream(TypeName); if (T) - T->print(OS); + T->print(TypeStream); else - OS << "Printing <null> Type"; - return OS.str(); + TypeStream << "Printing <null> Type"; + TypeStream.flush(); + return TypeName; } /// Returns the MDNode that represents type T if it is already created, or 0 |