Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Issue 2601513005: Don't walk inheritance chain of return type to make renaming decisions. (Closed)

Created:
4 years ago by Łukasz Anforowicz
Modified:
3 years, 11 months ago
Reviewers:
dcheng
CC:
chromium-reviews, nasko
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't walk the inheritance chain of a return type to make renaming decisions. Walking inheritance chain of a type is not a reliable renaming decision signal, because it depends too much on unrelated/fragile context. For example - walking the inheritance chain might not be possible if a class is forward declared, but would be possible if full class definition is available. Consequently, walking the inheritance chain can lead to making two different renaming decisions for the same file location (the interesting "Framame" bug). OTOH, finding the base method being overriden is 1) reliable and 2) is required to avoiding generating 2 different renames of a method name in base VS derived class. Considering the method being overriden is the approach that this CL switches to. Known cases that 1) need a "Get" prefix and 2) would have regressed after this CL are 3) covered by adding them to the hardcoded list in ShouldPrefixFunctionName. BUG=673031 Committed: https://crrev.com/004f407089920c3d104643c7a20b49bc14ad8fd2 Cr-Commit-Position: refs/heads/master@{#440791}

Patch Set 1 #

Patch Set 2 : Avoid regressing known cases that need a "Get" prefix - add them to the hardcoded list. #

Total comments: 2

Patch Set 3 : LayoutObject -> LayoutObjectFoo (to avoid testing ShouldPrefixFunctionName) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -24 lines) Patch
M tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp View 1 4 chunks +14 lines, -4 lines 0 comments Download
M tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc View 1 2 1 chunk +18 lines, -10 lines 0 comments Download
M tools/clang/rewrite_to_chrome_style/tests/methods-original.cc View 1 2 1 chunk +18 lines, -10 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
Łukasz Anforowicz
Daniel, can you PTAL? I believe that this CL should fix the "Framame" bug (the ...
4 years ago (2016-12-23 01:01:37 UTC) #4
dcheng
One question and one alternative proposal: Since we're splitting up edit generation from edit application, ...
4 years ago (2016-12-23 05:52:11 UTC) #6
Łukasz Anforowicz
On 2016/12/23 05:52:11, dcheng wrote: > Since we're splitting up edit generation from edit application, ...
3 years, 12 months ago (2016-12-27 19:36:10 UTC) #7
dcheng
On 2016/12/27 19:36:10, Łukasz Anforowicz wrote: > On 2016/12/23 05:52:11, dcheng wrote: > > Since ...
3 years, 12 months ago (2016-12-27 20:41:50 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2601513005/40001
3 years, 12 months ago (2016-12-27 21:26:38 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
3 years, 12 months ago (2016-12-27 21:36:41 UTC) #13
commit-bot: I haz the power
3 years, 11 months ago (2017-01-02 15:47:22 UTC) #15
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/004f407089920c3d104643c7a20b49bc14ad8fd2
Cr-Commit-Position: refs/heads/master@{#440791}

Powered by Google App Engine
This is Rietveld 408576698