[Lldb-commits] [lldb] r347087 - [Cocoa] Prefer llvm::SignExtend64. Pointed out by zturner.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Fri Nov 16 11:53:01 PST 2018
Author: davide
Date: Fri Nov 16 11:53:00 2018
New Revision: 347087
URL: http://llvm.org/viewvc/llvm-project?rev=347087&view=rev
Log:
[Cocoa] Prefer llvm::SignExtend64. Pointed out by zturner.
Modified:
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=347087&r1=347086&r2=347087&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Fri Nov 16 11:53:00 2018
@@ -773,8 +773,7 @@ static uint64_t decodeExponent(uint64_t
int64_t exp7 = exp;
// Tagged exponent field is 7-bit signed. Sign-extend the value to 64 bits
// before performing arithmetic.
- int64_t exp11 = ((exp7 << 57) >> 57) + TAGGED_DATE_EXPONENT_BIAS;
- return exp11;
+ return llvm::SignExtend64<7>(exp) + TAGGED_DATE_EXPONENT_BIAS;
}
static uint64_t decodeTaggedTimeInterval(uint64_t encodedTimeInterval) {
More information about the lldb-commits
mailing list