[llvm] r334111 - [ThinLTO] Make ValueInfo operator!= consistent with operator== (NFC)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 12:59:40 PDT 2018


Test case? (maybe a unit test if this isn't exercised otherwise yet)

On Wed, Jun 6, 2018 at 11:36 AM Teresa Johnson via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: tejohnson
> Date: Wed Jun  6 11:32:16 2018
> New Revision: 334111
>
> URL: http://llvm.org/viewvc/llvm-project?rev=334111&view=rev
> Log:
> [ThinLTO] Make ValueInfo operator!= consistent with operator== (NFC)
>
> Compare Ref pointers instead of GUID, to handle comparison with special
> empty/tombstone ValueInfo. This was already done for operator==, to
> support inserting ValueInfo into DenseMap, but I need the operator!=
> side change for upcoming AsmParser summary parsing support.
>
> Modified:
>     llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h
>
> Modified: llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h?rev=334111&r1=334110&r2=334111&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h (original)
> +++ llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h Wed Jun  6 11:32:16
> 2018
> @@ -179,14 +179,14 @@ struct ValueInfo {
>
>  inline bool operator==(const ValueInfo &A, const ValueInfo &B) {
>    assert(A.getRef() && B.getRef() &&
> -         "Need ValueInfo with non-null Ref to compare GUIDs");
> +         "Need ValueInfo with non-null Ref for comparison");
>    return A.getRef() == B.getRef();
>  }
>
>  inline bool operator!=(const ValueInfo &A, const ValueInfo &B) {
>    assert(A.getRef() && B.getRef() &&
> -         "Need ValueInfo with non-null Ref to compare GUIDs");
> -  return A.getGUID() != B.getGUID();
> +         "Need ValueInfo with non-null Ref for comparison");
> +  return A.getRef() != B.getRef();
>  }
>
>  inline bool operator<(const ValueInfo &A, const ValueInfo &B) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180611/9882c591/attachment.html>


More information about the llvm-commits mailing list