[llvm-commits] [llvm] r169886 - /llvm/trunk/lib/MC/MCAssembler.cpp

Eli Bendersky eliben at google.com
Tue Dec 11 09:16:01 PST 2012


Author: eliben
Date: Tue Dec 11 11:16:00 2012
New Revision: 169886

URL: http://llvm.org/viewvc/llvm-project?rev=169886&view=rev
Log:
Remove the RelaxAll overrule in MCAssembler::fixupNeedsRelaxation,
because that method is only getting called for MCInstFragment. These
fragments aren't even generated when RelaxAll is set, which is why the
flag reference here is superfluous. Removing it simplifies the code
with no harmful effects.

An assertion is added higher up to make sure this path is never
reached.

Modified:
    llvm/trunk/lib/MC/MCAssembler.cpp

Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=169886&r1=169885&r2=169886&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Tue Dec 11 11:16:00 2012
@@ -657,9 +657,6 @@
 bool MCAssembler::fixupNeedsRelaxation(const MCFixup &Fixup,
                                        const MCInstFragment *DF,
                                        const MCAsmLayout &Layout) const {
-  if (getRelaxAll())
-    return true;
-
   // If we cannot resolve the fixup value, it requires relaxation.
   MCValue Target;
   uint64_t Value;
@@ -780,6 +777,8 @@
     default:
       break;
     case MCFragment::FT_Inst:
+      assert(!getRelaxAll() &&
+             "Did not expect a MCInstFragment in RelaxAll mode");
       RelaxedFrag = relaxInstruction(Layout, *cast<MCInstFragment>(I));
       break;
     case MCFragment::FT_Dwarf:





More information about the llvm-commits mailing list