FailedChanges

Summary

  1. [clang-tidy] Add check for classes missing -hash ⚠️ (details)
  2. gn build: Merge r372445 (details)
  3. Support for 64-bit PC-relative relocations for X86_64 (details)
  4. Improve -Wtautological-overlap-compare (details)
  5. LiveIntervals: Add missing operator!= for segments (details)
  6. AMDGPU/GlobalISel: Allow selection of scalar min/max (details)
  7. avr targetinfo: remove unneeded dep on MC (details)
  8. Revert assertion added by r372394 (details)
  9. Merge and improve code that detects same value in comparisons. (details)
  10. Fix bad APInt compare. (details)
Commit 2f6a52816fc33cf24373ce2aaf7df08b95403f44 by mog
[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
llvm-svn: 372445
The file was modifiedclang-tools-extra/docs/ReleaseNotes.rst (diff)
The file was modifiedclang-tools-extra/clang-tidy/objc/CMakeLists.txt (diff)
The file was addedclang-tools-extra/docs/clang-tidy/checks/objc-missing-hash.rst
The file was addedclang-tools-extra/test/clang-tidy/objc-missing-hash.m
The file was addedclang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp
The file was addedclang-tools-extra/clang-tidy/objc/MissingHashCheck.h
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/list.rst (diff)
The file was modifiedclang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp (diff)
Commit c96d5545f0c97b3ad88672a09a4feeb7256ce2cb by llvmgnsyncbot
gn build: Merge r372445
llvm-svn: 372446
The file was modifiedllvm/utils/gn/secondary/clang-tools-extra/clang-tidy/objc/BUILD.gn (diff)
Commit 3e6590c45177958030513e6be199fc2d54f13ac7 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)
llvm-svn: 372447
The file was modifiedllvm/lib/Object/RelocationResolver.cpp (diff)
Commit 6541c7988b83b30b2590ca6b3e23585ae04a02a2 by rtrieu
Improve -Wtautological-overlap-compare
Allow this warning to detect a larger number of constant values,
including negative numbers, and handle non-int types better.
Differential Revision: https://reviews.llvm.org/D66044
llvm-svn: 372448
The file was modifiedclang/test/Sema/warn-overlap.c (diff)
The file was modifiedclang/test/SemaCXX/warn-unreachable.cpp (diff)
The file was modifiedclang/lib/Analysis/CFG.cpp (diff)
The file was modifiedclang/test/Analysis/cfg.cpp (diff)
The file was modifiedclang/docs/ReleaseNotes.rst (diff)
The file was modifiedclang/lib/Analysis/ReachableCode.cpp (diff)
The file was modifiedclang/test/Sema/warn-unreachable.c (diff)
Commit bd7f2354ccbaa50923b134b223349ae532443aba by Matthew.Arsenault
LiveIntervals: Add missing operator!= for segments
llvm-svn: 372449
The file was modifiedllvm/include/llvm/CodeGen/LiveInterval.h (diff)
Commit eb6eb694e42d85541a1abc79f6025425540f8a7c by Matthew.Arsenault
AMDGPU/GlobalISel: Allow selection of scalar min/max
I believe all of the uniform/divergent pattern predicates are redundant
and can be removed. The uniformity bit already influences the register
class, and nothhing has broken when I've removed this and others.
llvm-svn: 372450
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-smax.mir (diff)
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-umax.mir (diff)
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-smin.mir (diff)
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-umin.mir (diff)
The file was modifiedllvm/lib/Target/AMDGPU/SOPInstructions.td (diff)
Commit d98d3ea9fe382c2fd0beeaf170532bf8e3521d47 by nicolasweber
avr targetinfo: remove unneeded dep on MC
llvm-svn: 372451
The file was modifiedllvm/lib/Target/AVR/TargetInfo/LLVMBuild.txt (diff)
Commit 27a8039171817a38f76adf51793f0d22f84dd78e by Yaxun.Liu
Revert assertion added by r372394
The assertion added by r372394 causes CUDA test in test-suite to assert.
The assertion was not there originally, so revert it.
llvm-svn: 372452
The file was modifiedclang/lib/Sema/SemaCUDA.cpp (diff)
Commit 4c05de8c1d157f4b5e0091a52dbbcce7242ee485 by rtrieu
Merge and improve code that detects same value in comparisons.
-Wtautological-overlap-compare and self-comparison from
-Wtautological-compare relay on detecting the same operand in different
locations.  Previously, each warning had it's own operand checker.  Now,
both are merged together into one function that each can call.  The
function also now looks through member access and array accesses.
Differential Revision: https://reviews.llvm.org/D66045
llvm-svn: 372453
The file was modifiedclang/include/clang/AST/Expr.h (diff)
The file was modifiedclang/lib/AST/Expr.cpp (diff)
The file was modifiedclang/lib/Analysis/CFG.cpp (diff)
The file was modifiedclang/test/SemaCXX/self-comparison.cpp (diff)
The file was modifiedclang/docs/ReleaseNotes.rst (diff)
The file was modifiedclang/lib/Sema/SemaExpr.cpp (diff)
The file was modifiedclang/test/SemaCXX/compare-cxx2a.cpp (diff)
The file was modifiedclang/test/Analysis/array-struct-region.cpp (diff)
The file was modifiedclang/test/Sema/warn-overlap.c (diff)
Commit 77297f0761d2009e25d5d709cdcb041229f3493c by rtrieu
Fix bad APInt compare.
APInt comparison require both to have the same bitwidth.  Since only the
value is needed, use the compare function APInt::isSameValue instead.
llvm-svn: 372454
The file was modifiedclang/test/SemaCXX/self-comparison.cpp (diff)
The file was modifiedclang/lib/AST/Expr.cpp (diff)