This is an archive of the discontinued LLVM Phabricator instance.

[lldb] NFC modernize codebase with modernize-use-nullptr
ClosedPublic

Authored by kwk on May 13 2019, 1:27 AM.

Details

Summary

NFC = Non functional change

This commit is the result of modernizing the LLDB codebase by using
nullptr instread of 0 or NULL. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.

This is the command I ran and I to fix and format the code base:

run-clang-tidy.py \
	-header-filter='.*' \
	-checks='-*,modernize-use-nullptr' \
	-fix ~/dev/llvm-project/lldb/.* \
	-format \
	-style LLVM \
	-p ~/llvm-builds/debug-ninja-gcc
NOTE: There were also changes to llvm/utils/unittest but I did not include them because I felt that maybe this library shall be updated in isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most parts.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

kwk created this revision.May 13 2019, 1:27 AM
Herald added a reviewer: shafik. · View Herald Transcript
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
teemperor added a reviewer: Restricted Project.May 13 2019, 1:53 AM
teemperor added a subscriber: teemperor.
teemperor added inline comments.
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
76 ↗(On Diff #199211)

Can you revert the auto-formatting here?

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
114 ↗(On Diff #199211)

Can you revert the auto-formatting here (and in the next option definition)?

lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
603 ↗(On Diff #199211)

Could you also revert the unrelated whitespace changes here? Phabricator doesn't really display the whitespace changes well, but this patch effectively reformats this whole INIT_BOOL chain (The reformatting itself is fine, but it should be it's own commit).

martong resigned from this revision.May 13 2019, 2:15 AM
kwk added inline comments.May 13 2019, 2:22 AM
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
76 ↗(On Diff #199211)

@teemperor I sure could or if you want I can sourround this section with // clang-format off and // clang-format on to prevent it from being ever formatted again.

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
114 ↗(On Diff #199211)

@teemperor sure but same question: shall I use // clang-format off and // clang-format on here for the entire section?

lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
603 ↗(On Diff #199211)
teemperor added inline comments.May 13 2019, 2:30 AM
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
76 ↗(On Diff #199211)

I wouldn't do it in this patch, but in general that sounds like a good idea to add this to all the g_properties sections. I'll probably replace most of these sections with some tablegen soon(TM), so be aware that that work might only be short-lived :)

kwk added a comment.May 13 2019, 5:21 AM

@teemperor I've addressed all of your comments. Can you please have another look?

kwk retitled this revision from [lldb] modernize codebase with modernize-use-nullptr to [lldb] NFC modernize codebase with modernize-use-nullptr.May 13 2019, 5:30 AM
kwk edited the summary of this revision. (Show Details)
JDevlieghere added a subscriber: JDevlieghere.

I had a quick glance over the changes and they all look correct. It appears that the spurious formatting changes have been addressed as well. Just to be sure I applied the patch locally and it built and passed the test suite.

So this LGTM.

This revision is now accepted and ready to land.May 13 2019, 1:36 PM
kwk added a comment.May 15 2019, 5:02 AM

@JDevlieghere can you please commit this in my name? I don't have commit access yet. I've filed an email an hope to get it soon.

kwk added a comment.May 22 2019, 7:11 AM

@JDevlieghere I have commit access now. I'm currently working on rebasing my changes and resolving conflicts in these files where my patch wasn't rebaseable.

lldb/source/Core/ValueObject.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
kwk updated this revision to Diff 200886.May 23 2019, 1:46 AM
  • Ran git clang-format HEAD^ and picked changes by hand using git add -p
  • Remove left-overs from unfinished rebase before
kwk updated this revision to Diff 200916.May 23 2019, 3:07 AM

Unchanged commit

kwk updated this revision to Diff 200918.May 23 2019, 3:25 AM

Rebased onto master

kwk updated this revision to Diff 200925.May 23 2019, 4:00 AM

Rebase onto master

This revision was automatically updated to reflect the committed changes.