[cfe-commits] r129849 - /cfe/trunk/lib/Rewrite/Rewriter.cpp
jahanian
fjahanian at apple.com
Wed Apr 20 09:36:56 PDT 2011
On Apr 20, 2011, at 9:32 AM, Chris Lattner wrote:
>
> On Apr 20, 2011, at 6:35 AM, Douglas Gregor wrote:
>
>> Author: dgregor
>> Date: Wed Apr 20 08:35:54 2011
>> New Revision: 129849
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=129849&view=rev
>> Log:
>> Be sure to flush raw_string_ostream objects in the Objective-C
>> rewriter, from Eric Niebler!
>
> Hey Doug,
>
> Is this necessary? The first one uses S.str() which does the flush. I think a better answer is to change the second to use S.str().
Yes. Crash caused by the 2nd one which I recently added and did not use S.str(). I will make the change.
- Thanks, Fariborz
>
> -Chris
>
>>
>> Modified:
>> cfe/trunk/lib/Rewrite/Rewriter.cpp
>>
>> Modified: cfe/trunk/lib/Rewrite/Rewriter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Rewriter.cpp?rev=129849&r1=129848&r2=129849&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Rewrite/Rewriter.cpp (original)
>> +++ cfe/trunk/lib/Rewrite/Rewriter.cpp Wed Apr 20 08:35:54 2011
>> @@ -300,6 +300,7 @@
>> std::string SStr;
>> llvm::raw_string_ostream S(SStr);
>> To->printPretty(S, 0, PrintingPolicy(*LangOpts));
>> + S.flush();
>> const std::string &Str = S.str();
>>
>> ReplaceText(From->getLocStart(), Size, Str);
>> @@ -310,6 +311,7 @@
>> std::string SStr;
>> llvm::raw_string_ostream S(SStr);
>> From->printPretty(S, 0, PrintingPolicy(*LangOpts));
>> + S.flush();
>> return SStr;
>> }
>>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list