From d83a54fd35026b540b54df43abae0618d4527668 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 13 Oct 2011 23:27:48 +0000 Subject: [PATCH] Simplify assertion, and avoid undefined shift. Based on patch by Ahmed Charles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141912 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp index 039e59d1d61..69ad7d7b6b3 100644 --- a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp +++ b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp @@ -98,14 +98,7 @@ public: // Specifically ignore overflow/underflow as long as the leakage is // limited to the lower bits. This is to remain compatible with // other assemblers. - - const uint64_t Mask = ~0ULL; - const uint64_t UpperV = (Value >> (Size * 8)); - const uint64_t MaskF = (Mask >> (Size * 8)); - (void)UpperV; - (void)MaskF; - assert(((Size == 8) || - ((UpperV & MaskF) == 0ULL) || ((UpperV & MaskF) == MaskF)) && + assert(isIntN(Size * 8 + 1, Value) && "Value does not fit in the Fixup field"); for (unsigned i = 0; i != Size; ++i)