This is an archive of the discontinued LLVM Phabricator instance.

NFC: TreeTransform.h: make the function TransformNestedNameSpecifierLoc more beautiful
ClosedPublic

Authored by zhouyizhou on May 16 2021, 6:00 AM.

Details

Summary

Hi,
I am new to LLVM, and I really want to get involved in LLVM community.

I guess if the following switch case of function
TransformNestedNameSpecifierLoc could possibly made more beautiful with
'break' stmt moved inside of the right brace.

I think move of 'break' stmt will not change the invoking destructor of
IdInfo.

Thanks for your effort.

I have done make check-all on x86_64-linux
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>

Diff Detail

Event Timeline

zhouyizhou created this revision.May 16 2021, 6:00 AM
zhouyizhou requested review of this revision.May 16 2021, 6:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2021, 6:00 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I use git diff -U99999 instead

I do some "grep" in clang/lib directory:
llvm-project/clang/lib#find . -name "*.*"|xargs grep -n -B 2 "break;"|grep -A 2 "}"

my patch also seems to match the coding style of other parts of clang.

Thanks again

I think you can add a NFC in the title.

clang/lib/Sema/TreeTransform.h
4033–4037

There're some format issues in this function. It's better if you can fix them too. You can use clang-format to help with you.

zhouyizhou retitled this revision from TreeTransform.h: make the switch case more beautiful to NFC: TreeTransform.h: make the switch case more beautiful .

use clang-format to fix the function TransformNestedNameSpecifierLoc

zhouyizhou retitled this revision from NFC: TreeTransform.h: make the switch case more beautiful to NFC: TreeTransform.h: make the function TransformNestedNameSpecifierLoc more beautiful .May 17 2021, 2:10 AM
pengfei accepted this revision.May 17 2021, 2:58 AM

LGTM. Thanks for improving it.

This revision is now accepted and ready to land.May 17 2021, 2:58 AM