projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e77d2b8
)
[APInt] Use SignExtend64 instead of reinventing it. NFC
author
Craig Topper
<craig.topper@gmail.com>
Wed, 19 Apr 2017 20:32:11 +0000
(20:32 +0000)
committer
Craig Topper
<craig.topper@gmail.com>
Wed, 19 Apr 2017 20:32:11 +0000
(20:32 +0000)
llvm-svn: 300747
llvm/include/llvm/ADT/APInt.h
patch
|
blob
|
history
diff --git
a/llvm/include/llvm/ADT/APInt.h
b/llvm/include/llvm/ADT/APInt.h
index
b508c77
..
cdcb178
100644
(file)
--- a/
llvm/include/llvm/ADT/APInt.h
+++ b/
llvm/include/llvm/ADT/APInt.h
@@
-1433,8
+1433,7
@@
public:
/// int64_t. Otherwise an assertion will result.
int64_t getSExtValue() const {
if (isSingleWord())
- return int64_t(VAL << (APINT_BITS_PER_WORD - BitWidth)) >>
- (APINT_BITS_PER_WORD - BitWidth);
+ return SignExtend64(VAL, BitWidth);
assert(getMinSignedBits() <= 64 && "Too many bits for int64_t");
return int64_t(pVal[0]);
}