This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] clang-tidy (NFC)
ClosedPublic

Authored by aheejin on Jan 30 2019, 10:59 PM.

Details

Summary

This patch fixes clang-tidy warnings on wasm-only files.
The list of checks used is:
-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,readability-identifier-naming,modernize-*
(LLVM's default .clang-tidy list is the same except it does not have
modernize-*.)

The list of fixes are:

  • Variable names start with an uppercase letter
  • Function names start with a lowercase letter
  • Use auto when you use casts so the type is evident

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

aheejin created this revision.Jan 30 2019, 10:59 PM
aheejin edited the summary of this revision. (Show Details)Jan 30 2019, 11:01 PM
aheejin edited the summary of this revision. (Show Details)

Otherwise LGTM

wasm/InputChunks.cpp
43

I prefer the previous explicit version myself.. otherwise one has to visually cross reference the return type to see what is being returned here is an empty string.

wasm/Writer.cpp
1119

Can you leave these for now. I kind of like them being this format, plus I have a CL pending to add more and move them to a header file.

aheejin updated this revision to Diff 184645.Jan 31 2019, 4:20 PM
aheejin marked 2 inline comments as done.
  • Address comments
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2019, 4:20 PM
aheejin edited the summary of this revision. (Show Details)Jan 31 2019, 4:25 PM
aheejin marked an inline comment as done.Jan 31 2019, 10:21 PM
aheejin added inline comments.
wasm/Writer.cpp
44

I guess you prefer to revert these too? Just checking before actually reverting.

sbc100 accepted this revision.Feb 4 2019, 10:12 AM
This revision is now accepted and ready to land.Feb 4 2019, 10:12 AM
aheejin marked an inline comment as done.Feb 4 2019, 10:26 AM
aheejin added inline comments.
wasm/Writer.cpp
44

So would you like to revert these?

aheejin marked an inline comment as done.Feb 4 2019, 11:10 AM
aheejin added inline comments.
wasm/Writer.cpp
44

Will land this; let me know if you want to revert that afterwards.

This revision was automatically updated to reflect the committed changes.