[llvm-commits] [llvm] r141912 - /llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp

Eli Friedman eli.friedman at gmail.com
Thu Oct 13 16:27:48 PDT 2011


Author: efriedma
Date: Thu Oct 13 18:27:48 2011
New Revision: 141912

URL: http://llvm.org/viewvc/llvm-project?rev=141912&view=rev
Log:
Simplify assertion, and avoid undefined shift.  Based on patch by Ahmed Charles.


Modified:
    llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp

Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp?rev=141912&r1=141911&r2=141912&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp Thu Oct 13 18:27:48 2011
@@ -98,14 +98,7 @@
     // 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)





More information about the llvm-commits mailing list