Issue metadata
Sign in to add a comment
|
rewrite_to_chrome_style: no member named 'kSafeToCompareToEmptyOrDeleted' |
||||||||||||||||||||
Issue description
We have regressed ability to cleanly build third_party/WebKit/Source/wtf:wtf after a dry-run of the Great Blink Rename.
In particular:
$ ninja -C out/gn obj/third_party/WebKit/Source/wtf/wtf/TextEncodingRegistry.o
...
../../third_party/WebKit/Source/wtf/HashTable.h:1028:26: error: no member named 'kSafeToCompareToEmptyOrDeleted' in 'WTF::TextEncodingNameHash'
HashFunctions::kSafeToCompareToEmptyOrDeleted>::CheckKey(key)));
...
,
Jan 25 2017
I guess the usage of it went the wrong way somehow?
,
Jan 25 2017
,
Jan 25 2017
After automatic rename, I see the following state:
$ find . -type f | xargs grep safe_to_compare_to_empty_or_deleted
./LinkedHashSet.h: static const bool safe_to_compare_to_empty_or_deleted = false;
./text/TextEncodingRegistry.cpp: static const bool safe_to_compare_to_empty_or_deleted = false;
./text/AtomicStringHash.h: static const bool safe_to_compare_to_empty_or_deleted = false;
./text/StringHash.h: static const bool safe_to_compare_to_empty_or_deleted = false;
./text/StringHash.h: static const bool safe_to_compare_to_empty_or_deleted = false;
./HashSetTest.cpp: static const bool safe_to_compare_to_empty_or_deleted = true;
./HashSetTest.cpp: static const bool safe_to_compare_to_empty_or_deleted = true;
./ListHashSet.h: static const bool safe_to_compare_to_empty_or_deleted = false;
./HashMapTest.cpp: static const bool safe_to_compare_to_empty_or_deleted = true;
./HashFunctions.h: static const bool safe_to_compare_to_empty_or_deleted = true;
./HashFunctions.h: static const bool safe_to_compare_to_empty_or_deleted = true;
./HashFunctions.h: static const bool safe_to_compare_to_empty_or_deleted = true;
./HashFunctions.h: static const bool safe_to_compare_to_empty_or_deleted =
./HashFunctions.h: static const bool safe_to_compare_to_empty_or_deleted =
~/src/chromium4/src/third_party/WebKit/Source/wtf on (HEAD detached at 4ecf949ea6d9)*
$ find . -type f | xargs grep kSafeToCompareToEmptyOrDeleted
./HashTable.h: HashFunctions::kSafeToCompareToEmptyOrDeleted>::CheckKey(key)));
./HashTable.h: if (HashFunctions::kSafeToCompareToEmptyOrDeleted) {
./HashTable.h: if (HashFunctions::kSafeToCompareToEmptyOrDeleted) {
./HashTable.h: if (HashFunctions::kSafeToCompareToEmptyOrDeleted) {
,
Jan 25 2017
This repros with:
template-original.cc:
namespace blink {
...
namespace safe_to_compate_to_empty_or_deleted_trouble {
template <typename T>
class TypeTrait {
public:
static const bool safeToCompareToEmptyOrDeleted = false;
};
template <>
class TypeTrait<int> {
public:
static const bool safeToCompareToEmptyOrDeleted = true;
};
template <typename T>
bool foo() {
return TypeTrait<T>::safeToCompareToEmptyOrDeleted;
}
} // namespace safe_to_compate_to_empty_or_deleted_trouble
template-expected.cc:
namespace blink {
...
namespace safe_to_compate_to_empty_or_deleted_trouble {
template <typename T>
class TypeTrait {
public:
static const bool safe_to_compare_to_empty_or_deleted = false;
};
template <>
class TypeTrait<int> {
public:
static const bool safe_to_compare_to_empty_or_deleted = true;
};
template <typename T>
bool Foo() {
return TypeTrait<T>::safe_to_compare_to_empty_or_deleted;
}
} // namespace safe_to_compate_to_empty_or_deleted_trouble
And the diff is as danakj@ suggested in the usage:
- return TypeTrait<T>::safe_to_compare_to_empty_or_deleted;
+ return TypeTrait<T>::safeToCompareToEmptyOrDeleted;
,
Jan 25 2017
,
Jan 25 2017
,
Jan 25 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9c0001763fde79549c208242560bc0d9245c6441 commit 9c0001763fde79549c208242560bc0d9245c6441 Author: danakj <danakj@chromium.org> Date: Wed Jan 25 19:55:03 2017 Rename references to type traits the same as we rename the traits. R=dcheng@chromium.org BUG= 685264 , 598177 Review-Url: https://codereview.chromium.org/2655943003 Cr-Commit-Position: refs/heads/master@{#446096} [modify] https://crrev.com/9c0001763fde79549c208242560bc0d9245c6441/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp [modify] https://crrev.com/9c0001763fde79549c208242560bc0d9245c6441/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc [modify] https://crrev.com/9c0001763fde79549c208242560bc0d9245c6441/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc
,
Jan 25 2017
lmk if more things are broken tho..
,
Jan 28 2017
We seem to generate conflicting edits here: $ cat ~/scratch/run_tool.edits | tools/clang/scripts/apply_edits.py out/gn Conflicting edit: /usr/local/google/home/lukasza/src/chromium4/src/third_party/WebKit/Source/wtf/HashTable.h at offset 38635, length 29: "kSafeToCompareToEmptyOrDeleted" != "safe_to_compare_to_empty_or_deleted" Conflicting edit: /usr/local/google/home/lukasza/src/chromium4/src/third_party/WebKit/Source/wtf/HashTable.h at offset 34211, length 29: "kSafeToCompareToEmptyOrDeleted" != "safe_to_compare_to_empty_or_deleted" Conflicting edit: /usr/local/google/home/lukasza/src/chromium4/src/third_party/WebKit/Source/wtf/HashTable.h at offset 32632, length 29: "kSafeToCompareToEmptyOrDeleted" != "safe_to_compare_to_empty_or_deleted" Conflicting edit: /usr/local/google/home/lukasza/src/chromium4/src/third_party/WebKit/Source/wtf/HashTable.h at offset 32284, length 29: "kSafeToCompareToEmptyOrDeleted" != "safe_to_compare_to_empty_or_deleted" Applied 878496 edits (4 errors) to 9046 files [100.00%]
,
Jan 28 2017
Nooo. Why does this trait have to be so hard. Thanks for the info D:
,
Jan 29 2017
When investigating this, in addition to #c10 it might be useful to look at compilation as well. Interestignly, after an automatic rename, 1) building of third_party/WebKit/Source/wtf:wtf and third_party/WebKit/Source/wtf:wtf_unittests works just fine. 2) OTOH, there are quite a few build errors outside of wtf. Some examples: Building of obj/third_party/WebKit/Source/core/animation/animation/LengthListPropertyFunctions.o target fails with: ../../third_party/WebKit/Source/wtf/HashTable.h:1256:24: error: no member named 'safe_to_compare_to_empty_or_deleted' in 'blink::ShapeCache::SmallStringKeyHash' Building of obj/third_party/WebKit/Source/core/core_generated/ScriptValueSerializer.o target fails with: ../../third_party/WebKit/Source/wtf/HashTable.h:1256:24: error: no member named 'safe_to_compare_to_empty_or_deleted' in 'blink::V8ObjectMap<v8::Object, unsigned int>::V8HandlePtrHash<v8::Object>'
,
Jan 30 2017
Hm. https://cs.chromium.org/chromium/src/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h?rcl=0&l=93 When I did git grep though I didn't find any instances of safeToCompareToEmptyOrDeleted afterward, I wonder what I missed.
,
Jan 30 2017
I think my brute force patch will work, I don't see errors related to this for those 2 files now.
,
Jan 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bc7ab72c78b36430b6c77078d2ad9790d1bf79c0 commit bc7ab72c78b36430b6c77078d2ad9790d1bf79c0 Author: danakj <danakj@chromium.org> Date: Tue Jan 31 00:43:02 2017 Force the safeToCompareToEmptyOrDeleted trait to be renamed correctly This simply renames all varDecl and varDeclRefs with that name to safe_to_compare_to_empty_or_deleted. It leaves matchers for outside of the blink namespace still. R=dcheng@chromium.org BUG= 685264 Review-Url: https://codereview.chromium.org/2663043002 Cr-Commit-Position: refs/heads/master@{#447136} [modify] https://crrev.com/bc7ab72c78b36430b6c77078d2ad9790d1bf79c0/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
,
Jan 31 2017
ONCE AND FOR ALL? |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by danakj@chromium.org
, Jan 25 2017