New issue
Advanced search Search tips

Issue 598142 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

rewrite_to_chrome_style: reference to FilePrintStream::Print not rewritten

Project Member Reported by dcheng@chromium.org, Mar 26 2016

Issue description

After running the tool across WTF, I had to manually apply this fixup patch:

diff --git a/third_party/WebKit/Source/wtf/DataLog.h b/third_party/WebKit/Source/wtf/DataLog.h
index 15f0153..41af540 100644
--- a/third_party/WebKit/Source/wtf/DataLog.h
+++ b/third_party/WebKit/Source/wtf/DataLog.h
@@ -44,7 +44,7 @@ WTF_EXPORT void DataLogFString(const char*);
 template<typename... T>
 void DataLog(const T&... values)
 {
-    DataFile().print(values...);
+    DataFile().Print(values...);
 }
 
 } // namespace WTF
 

Comment 1 by dcheng@chromium.org, Mar 26 2016

Looks like print() here is an UnresolvedMemberExpr:

| `-FunctionTemplateDecl 0x7717bb8 <../../third_party/WebKit/Source/wtf/DataLog.h:44:1, line:48:1> line:45:6 dataLog
|   |-TemplateTypeParmDecl 0x7717948 <line:44:10, col:22> col:22 referenced typename ... T
|   `-FunctionDecl 0x7717b10 <line:45:1, line:48:1> line:45:6 dataLog 'void (const T &...)'
|     |-ParmVarDecl 0x7717a48 <col:14, col:26> col:26 referenced values 'const T &...'
|     `-CompoundStmt 0x7717de0 <line:46:1, line:48:1>
|       `-CallExpr 0x7717db0 <line:47:5, col:31> '<dependent type>'
|         |-UnresolvedMemberExpr 0x7717cf8 <col:5, col:16> '<bound member function type>' lvalue
|         | `-CallExpr 0x7717cd0 <col:5, col:14> 'class WTF::FilePrintStream' lvalue
|         |   `-ImplicitCastExpr 0x7717cb8 <col:5> 'class WTF::FilePrintStream &(*)(void)' <FunctionToPointerDecay>
|         |     `-DeclRefExpr 0x7717c68 <col:5> 'class WTF::FilePrintStream &(void)' lvalue Function 0x7717230 'dataFile' 'class WTF::FilePrintStream &(void)'
|         `-PackExpansionExpr 0x7717d90 <col:22, col:28> '<dependent type>' lvalue
|           `-DeclRefExpr 0x7717d68 <col:22> 'const T &...' lvalue ParmVar 0x7717a48 'values' 'const T &...'

Comment 2 by danakj@chromium.org, Mar 28 2016

Does this work if you run it on everything? Maybe this is called from outside WTF? We could add a call in a unittest?
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/663008c70f0e5d9bfc95db70aa703432847f23ad

commit 663008c70f0e5d9bfc95db70aa703432847f23ad
Author: dcheng <dcheng@chromium.org>
Date: Mon Mar 28 20:36:44 2016

rewrite_to_chrome_style: improve template rewrite handling

- Handles UnresolvedMemberExprs to rewrite unresolved references to
  methods in a member context.
- Use the correct SourceLocation when rewriting UnresolvedLookupExprs
  to avoid clobbering nested name specifiers.

BUG= 598140 , 598142 
R=danakj@chromium.org

Review URL: https://codereview.chromium.org/1838713002

Cr-Commit-Position: refs/heads/master@{#383554}

[modify] https://crrev.com/663008c70f0e5d9bfc95db70aa703432847f23ad/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
[modify] https://crrev.com/663008c70f0e5d9bfc95db70aa703432847f23ad/tools/clang/rewrite_to_chrome_style/tests/template-expected.cc
[modify] https://crrev.com/663008c70f0e5d9bfc95db70aa703432847f23ad/tools/clang/rewrite_to_chrome_style/tests/template-original.cc

Comment 4 by dcheng@chromium.org, Mar 28 2016

Status: Fixed (was: Assigned)
To clarify, I had a custom build where I changed in_blink_namespace to only match WTF, and then ran it over the entire codebase. It still reproed in that case.

Sign in to add a comment