[cfe-commits] r68268 - in /cfe/trunk: include/clang/Frontend/FixItRewriter.h lib/Frontend/FixItRewriter.cpp lib/Parse/ParseInit.cpp lib/Sema/SemaDeclCXX.cpp test/Sema/fixit-c90.c test/Sema/fixit-errors.c test/Sema/fixit.c test/SemaCXX/fixit.cpp tools/clang-cc/clang-cc.cpp
Chris Lattner
clattner at apple.com
Thu Apr 2 09:42:56 PDT 2009
On Apr 2, 2009, at 9:32 AM, Douglas Gregor wrote:
>>> + }
>>> + OutFile->flush();
>>
>> Should OutFile be flushed or deleted here? If OwnedStream will
>> destroy it, then it doesn't need to be flushed.
>
> OutFile might be &llvm::outs(), in which case it's a good idea to
> flush.
Ok
>>> +void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel,
>>> + const DiagnosticInfo &Info) {
>>> + if (Client)
>>> + Client->HandleDiagnostic(DiagLevel, Info);
>>> +
>>> + // Make sure that we can perform all of the modifications we
>>> + // in this diagnostic.
>>> + bool CanRewrite = true;
>>> + for (unsigned Idx = 0; Idx <
>>> Info.getNumCodeModificationHints(); ++Idx) {
>>
>> Please don't call Info.getNumCodeModificationHints() each time
>> through the loop :)
>
> Alright, which joker put Fix-It on the critical path?
It's about a consistent style, not about microoptimizing this case in
particular :)
-Chris
More information about the cfe-commits
mailing list