This is an archive of the discontinued LLVM Phabricator instance.

Switch from C-style comments `/* ... */` to C++ style `//` (NFC)
ClosedPublic

Authored by mehdi_amini on Nov 3 2020, 6:03 PM.

Details

Summary

This is mostly a scripted update, it may not be perfect.

function replace() {

FROM=$1
TO=$2
git grep "$FROM" $REPO_PATH |cut -f 1 -d : | sort -u | \
  while read file; do
    sed -i "s#$FROM#$TO#" $file ;
  done

}

replace '|\*===----------------------------------------------------------------------===\*|$' '===----------------------------------------------------------------------==='
replace '^/\* =' '=='
replace '^/\*=' '
='
replace '^\\\*=' '='
replace '^|\*' '
'
replace ' \*|$' ''
replace '=\*\\$' '='
replace '== \*/$' '===
'
replace '==\*/$' '=='
replace '^/\*\*\(.*\)\*/$' '
/\1'
replace '^/\*\(.*\)\*/$' '\1'
replace '
============================================================================' '===----------------------------------------------------------------------===//'

Diff Detail

Event Timeline

mehdi_amini created this revision.Nov 3 2020, 6:03 PM
Herald added a project: Restricted Project. · View Herald Transcript
mehdi_amini requested review of this revision.Nov 3 2020, 6:03 PM

Minor tweak

mehdi_amini edited the summary of this revision. (Show Details)

Update description

lattner accepted this revision.Nov 3 2020, 8:57 PM
lattner added a subscriber: lattner.

Wow, very impressive regex-fu mehdi! It looks like one more pattern is needed, but amazing work!

mlir/lib/CAPI/IR/IR.cpp
163–165

This looks like one more pattern to add to your regex

mlir/tools/mlir-tblgen/PassCAPIGen.cpp
41 ↗(On Diff #302724)

This line probably shouldn't be included unless tblgen is updated.

This revision is now accepted and ready to land.Nov 3 2020, 8:57 PM
mehdi_amini marked an inline comment as done.
mehdi_amini edited the summary of this revision. (Show Details)

Address comment

mehdi_amini added inline comments.Nov 3 2020, 9:12 PM
mlir/lib/CAPI/IR/IR.cpp
163–165

Well spotted! (There was a typo in one of the pattern)

ftynse accepted this revision.Nov 4 2020, 12:52 AM

Thanks!

silvas accepted this revision.Nov 4 2020, 9:01 AM
silvas added a subscriber: silvas.
silvas added inline comments.
mlir/include/mlir-c/AffineExpr.h
20

Random consistency question:

Why

//============================================================================//

instead of the more typical

//===----------------------------------------------------------------------===//

?

LGTM either way.

Address Sean's comment

mehdi_amini marked an inline comment as done.Nov 4 2020, 10:10 AM
mehdi_amini added inline comments.
mlir/include/mlir-c/AffineExpr.h
20

No reason, updated! Thanks.

mehdi_amini edited the summary of this revision. (Show Details)Nov 4 2020, 10:10 AM
This revision was landed with ongoing or failed builds.Nov 4 2020, 10:11 AM
This revision was automatically updated to reflect the committed changes.
mehdi_amini marked an inline comment as done.