This is an archive of the discontinued LLVM Phabricator instance.

[Diagnsotics] Small Improvement on -Wmisleading-indentation
ClosedPublic

Authored by Tyker on Dec 5 2019, 11:10 AM.

Diff Detail

Event Timeline

xbolva00 added inline comments.
clang/lib/Parse/ParseStmt.cpp
1219–1221

DiagnosticsEngine‘s isIgnored?

Tyker updated this revision to Diff 232422.Dec 5 2019, 11:41 AM
Tyker marked an inline comment as done.
aaron.ballman added inline comments.Dec 6 2019, 12:48 PM
clang/lib/Parse/ParseStmt.cpp
1219–1221

Rather than querying the diagnostics engine for each call to Check(), I think you can query this property once in the constructor and then do a simple member variable test here instead.

1229–1230

Under what circumstances is this required (can we generate a test case for it)?

Tyker updated this revision to Diff 232924.Dec 9 2019, 1:29 PM
Tyker marked 2 inline comments as done.
Tyker marked an inline comment as done.
Tyker added inline comments.
clang/lib/Parse/ParseStmt.cpp
1219–1221

Check() is called only once per object so there should be no difference. and DiagnosticsEngine::isIgnored requests the location of the location at which the warning is supposed to appear. this location is not know during the construction of the object.

1229–1230

i managed to reproduced it https://godbolt.org/z/XqVNPD

aaron.ballman accepted this revision.Dec 10 2019, 10:26 AM

LGTM

clang/lib/Parse/ParseStmt.cpp
1219–1221

Okay, sounds good

This revision is now accepted and ready to land.Dec 10 2019, 10:26 AM
This revision was automatically updated to reflect the committed changes.
Tyker marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2019, 5:56 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript