Re: [PATCH] D24648: Fix unused result from sign extending an Offset.

2016-09-16 Thread Stephen Hines via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL281706: Fix unused result from sign extending an Offset. 
(authored by srhines).

Changed prior to commit:
  https://reviews.llvm.org/D24648?vs=71598&id=71599#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24648

Files:
  cfe/trunk/lib/Sema/SemaChecking.cpp

Index: cfe/trunk/lib/Sema/SemaChecking.cpp
===
--- cfe/trunk/lib/Sema/SemaChecking.cpp
+++ cfe/trunk/lib/Sema/SemaChecking.cpp
@@ -3882,7 +3882,7 @@
   // possible.
   if (Ov) {
 assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too big");
-Offset.sext(2 * BitWidth);
+Offset = Offset.sext(2 * BitWidth);
 sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
 return;
   }


Index: cfe/trunk/lib/Sema/SemaChecking.cpp
===
--- cfe/trunk/lib/Sema/SemaChecking.cpp
+++ cfe/trunk/lib/Sema/SemaChecking.cpp
@@ -3882,7 +3882,7 @@
   // possible.
   if (Ov) {
 assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too big");
-Offset.sext(2 * BitWidth);
+Offset = Offset.sext(2 * BitWidth);
 sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
 return;
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D24648: Fix unused result from sign extending an Offset.

2016-09-15 Thread Stephen Hines via cfe-commits
It is marked LLVM_ATTRIBUTE_UNUSED_RESULT (which boils down to having
__warn_unused_result__). I am not sure why this didn't trigger during any
local build/test that we did.

Steve

On Thu, Sep 15, 2016 at 11:45 PM, David Majnemer 
wrote:

> sext should probably be marked WARN_UNUSED_RESULT
>
>
> On Thursday, September 15, 2016, Stephen Hines via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> srhines created this revision.
>> srhines added a reviewer: cfe-commits.
>> srhines added a subscriber: meikeb.
>>
>> Offset was doubled in size, but the assignment was missing. We just need
>> to reassign to the original variable in this case to fix it.
>>
>> https://reviews.llvm.org/D24648
>>
>> Files:
>>   lib/Sema/SemaChecking.cpp
>>
>> Index: lib/Sema/SemaChecking.cpp
>> ===
>> --- lib/Sema/SemaChecking.cpp
>> +++ lib/Sema/SemaChecking.cpp
>> @@ -3882,7 +3882,7 @@
>>// possible.
>>if (Ov) {
>>  assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too
>> big");
>> -Offset.sext(2 * BitWidth);
>> +Offset = Offset.sext(2 * BitWidth);
>>  sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
>>  return;
>>}
>>
>>
>>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D24648: Fix unused result from sign extending an Offset.

2016-09-15 Thread David Majnemer via cfe-commits
sext should probably be marked WARN_UNUSED_RESULT

On Thursday, September 15, 2016, Stephen Hines via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> srhines created this revision.
> srhines added a reviewer: cfe-commits.
> srhines added a subscriber: meikeb.
>
> Offset was doubled in size, but the assignment was missing. We just need
> to reassign to the original variable in this case to fix it.
>
> https://reviews.llvm.org/D24648
>
> Files:
>   lib/Sema/SemaChecking.cpp
>
> Index: lib/Sema/SemaChecking.cpp
> ===
> --- lib/Sema/SemaChecking.cpp
> +++ lib/Sema/SemaChecking.cpp
> @@ -3882,7 +3882,7 @@
>// possible.
>if (Ov) {
>  assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too
> big");
> -Offset.sext(2 * BitWidth);
> +Offset = Offset.sext(2 * BitWidth);
>  sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
>  return;
>}
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D24648: Fix unused result from sign extending an Offset.

2016-09-15 Thread Stephen Hines via cfe-commits
srhines created this revision.
srhines added a reviewer: cfe-commits.
srhines added a subscriber: meikeb.

Offset was doubled in size, but the assignment was missing. We just need
to reassign to the original variable in this case to fix it.

https://reviews.llvm.org/D24648

Files:
  lib/Sema/SemaChecking.cpp

Index: lib/Sema/SemaChecking.cpp
===
--- lib/Sema/SemaChecking.cpp
+++ lib/Sema/SemaChecking.cpp
@@ -3882,7 +3882,7 @@
   // possible.
   if (Ov) {
 assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too big");
-Offset.sext(2 * BitWidth);
+Offset = Offset.sext(2 * BitWidth);
 sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
 return;
   }


Index: lib/Sema/SemaChecking.cpp
===
--- lib/Sema/SemaChecking.cpp
+++ lib/Sema/SemaChecking.cpp
@@ -3882,7 +3882,7 @@
   // possible.
   if (Ov) {
 assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too big");
-Offset.sext(2 * BitWidth);
+Offset = Offset.sext(2 * BitWidth);
 sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
 return;
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits