FailedChanges

Summary

  1. Support for 64-bit PC-relative relocations for X86_64 ELF files generated for X86_64 targets may contain 64-bit PC-relative relocations. For instance, an exception handler table entry contains the start of exception-throwing frame relative to the start of exception handler. As these two labels belong to different sections, their difference and so the relocation is 64-bit. An attempt to parse such file, i.e. in DWARFContext::create, results in "failed to compute relocation" error. This fix adds support for such relocations to RelocationResolver.cpp. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D67779 Patch by Oleg Pliss (Oleg.Pliss@azul.com)
  2. gn build: Merge r372445
  3. [clang-tidy] Add check for classes missing -hash ⚠️ Summary: Apple documentation states that: "If two objects are equal, they must have the same hash value. This last point is particularly important if you define isEqual: in a subclass and intend to put instances of that subclass into a collection. Make sure you also define hash in your subclass." https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418795-isequal?language=objc In many or all versions of libobjc, -[NSObject isEqual:] is a pointer equality check and -[NSObject hash] returns the messaged object's pointer. A relatively common form of developer error is for a developer to override -isEqual: in a subclass without overriding -hash to ensure that hashes are equal for objects that are equal. It is assumed that an override of -isEqual: is a strong signal for changing the object's equality operator to something other than pointer equality which implies that a missing override of -hash could result in distinct objects being equal but having distinct hashes because they are independent instances. This added check flags classes that override -isEqual: but inherit NSObject's implementation of -hash to warn of the potential for unexpected behavior. The proper implementation of -hash is the responsibility of the developer and the check will only verify that the developer made an effort to properly implement -hash. Developers can set up unit tests to verify that their implementation of -hash is appropriate. Test Notes: Ran check-clang-tools. Reviewers: aaron.ballman, benhamilton Reviewed By: aaron.ballman Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67737
Revision 372447 by apilipenko:
Support for 64-bit PC-relative relocations for X86_64

ELF files generated for X86_64 targets may contain 64-bit PC-relative
relocations. For instance, an exception handler table entry contains the start
of exception-throwing frame relative to the start of exception handler. As these
two labels belong to different sections, their difference and so the relocation
is 64-bit.

An attempt to parse such file, i.e. in DWARFContext::create, results in "failed
to compute relocation" error.

This fix adds support for such relocations to RelocationResolver.cpp.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D67779

Patch by Oleg Pliss (Oleg.Pliss@azul.com)
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Object/RelocationResolver.cpp (diff)llvm.src/lib/Object/RelocationResolver.cpp
Revision 372446 by gnsyncbot:
gn build: Merge r372445
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/utils/gn/secondary/clang-tools-extra/clang-tidy/objc/BUILD.gn (diff)llvm.src/utils/gn/secondary/clang-tools-extra/clang-tidy/objc/BUILD.gn
Revision 372445 by stephanemoore:
[clang-tidy] Add check for classes missing -hash ⚠️

Summary:
Apple documentation states that:
"If two objects are equal, they must have the same hash value. This last
point is particularly important if you define isEqual: in a subclass and
intend to put instances of that subclass into a collection. Make sure
you also define hash in your subclass."
https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418795-isequal?language=objc

In many or all versions of libobjc, -[NSObject isEqual:] is a pointer
equality check and -[NSObject hash] returns the messaged object's
pointer. A relatively common form of developer error is for a developer to
override -isEqual: in a subclass without overriding -hash to ensure that
hashes are equal for objects that are equal.

It is assumed that an override of -isEqual: is a strong signal for
changing the object's equality operator to something other than pointer
equality which implies that a missing override of -hash could result in
distinct objects being equal but having distinct hashes because they are
independent instances. This added check flags classes that override
-isEqual: but inherit NSObject's implementation of -hash to warn of the
potential for unexpected behavior.

The proper implementation of -hash is the responsibility of the
developer and the check will only verify that the developer made an
effort to properly implement -hash. Developers can set up unit tests
to verify that their implementation of -hash is appropriate.

Test Notes:
Ran check-clang-tools.

Reviewers: aaron.ballman, benhamilton

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67737
Change TypePath in RepositoryPath in Workspace
The file was modified/clang-tools-extra/trunk/clang-tidy/objc/CMakeLists.txt (diff)clang-tools-extra.src/clang-tidy/objc/CMakeLists.txt
The file was added/clang-tools-extra/trunk/clang-tidy/objc/MissingHashCheck.cppclang-tools-extra.src/clang-tidy/objc/MissingHashCheck.cpp
The file was added/clang-tools-extra/trunk/clang-tidy/objc/MissingHashCheck.hclang-tools-extra.src/clang-tidy/objc/MissingHashCheck.h
The file was modified/clang-tools-extra/trunk/clang-tidy/objc/ObjCTidyModule.cpp (diff)clang-tools-extra.src/clang-tidy/objc/ObjCTidyModule.cpp
The file was modified/clang-tools-extra/trunk/docs/ReleaseNotes.rst (diff)clang-tools-extra.src/docs/ReleaseNotes.rst
The file was modified/clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst (diff)clang-tools-extra.src/docs/clang-tidy/checks/list.rst
The file was added/clang-tools-extra/trunk/docs/clang-tidy/checks/objc-missing-hash.rstclang-tools-extra.src/docs/clang-tidy/checks/objc-missing-hash.rst
The file was added/clang-tools-extra/trunk/test/clang-tidy/objc-missing-hash.mclang-tools-extra.src/test/clang-tidy/objc-missing-hash.m