- fix return type: ClangExpressionParser::Parse returns unsigned, but was actually returning a signed value, num_errors.
- use helper clang::TextDiagnosticBuffer::getNumErrors() instead of counting the errors ourself.
- limit scoping of block-level automatic variables as much as practical.
- remove reused multipurpose TextDiagnosticBuffer::const_iterator in favour of loop-scoped err, warn, and note variables in the diagnostic printing code.
- refactor diagnostic printing loops to use a proper loop invariant.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Aside from a minor nit, this looks like good cleanup. If it passes the testsuite, feel free to commit after addressing the inline comment.
source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp | ||
---|---|---|
522 | I'm okay with use of auto when the type is really onerous to express in code, but in this case TextDiagnosticBuffer::const_iterator is pretty compact, and makes the type of warn more obvious. Could we use that instead of auto? |
I'm okay with use of auto when the type is really onerous to express in code, but in this case TextDiagnosticBuffer::const_iterator is pretty compact, and makes the type of warn more obvious. Could we use that instead of auto?