[lld] r203405 - [Mips] Reduce the code indentation.

Simon Atanasyan simon at atanasyan.com
Sun Mar 9 06:05:26 PDT 2014


Author: atanasyan
Date: Sun Mar  9 08:05:26 2014
New Revision: 203405

URL: http://llvm.org/viewvc/llvm-project?rev=203405&view=rev
Log:
[Mips] Reduce the code indentation.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFWriters.h

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFWriters.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFWriters.h?rev=203405&r1=203404&r2=203405&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFWriters.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFWriters.h Sun Mar  9 08:05:26 2014
@@ -42,24 +42,25 @@ public:
   }
 
   void finalizeMipsRuntimeAtomValues() {
-    if (_mipsLinkingContext.isDynamic()) {
-      auto gotSection = _mipsTargetLayout.findOutputSection(".got");
-      auto got = gotSection ? gotSection->virtualAddr() : 0;
-      auto gp = gotSection ? got + _mipsTargetLayout.getGPOffset() : 0;
-
-      auto gotAtomIter =
-          _mipsTargetLayout.findAbsoluteAtom("_GLOBAL_OFFSET_TABLE_");
-      assert(gotAtomIter != _mipsTargetLayout.absoluteAtoms().end());
-      (*gotAtomIter)->_virtualAddr = got;
-
-      auto gpAtomIter = _mipsTargetLayout.findAbsoluteAtom("_gp");
-      assert(gpAtomIter != _mipsTargetLayout.absoluteAtoms().end());
-      (*gpAtomIter)->_virtualAddr = gp;
-
-      AtomLayout *gpAtom = _mipsTargetLayout.getGP();
-      assert(gpAtom != nullptr);
-      gpAtom->_virtualAddr = gp;
-    }
+    if (!_mipsLinkingContext.isDynamic())
+      return;
+
+    auto gotSection = _mipsTargetLayout.findOutputSection(".got");
+    auto got = gotSection ? gotSection->virtualAddr() : 0;
+    auto gp = gotSection ? got + _mipsTargetLayout.getGPOffset() : 0;
+
+    auto gotAtomIter =
+        _mipsTargetLayout.findAbsoluteAtom("_GLOBAL_OFFSET_TABLE_");
+    assert(gotAtomIter != _mipsTargetLayout.absoluteAtoms().end());
+    (*gotAtomIter)->_virtualAddr = got;
+
+    auto gpAtomIter = _mipsTargetLayout.findAbsoluteAtom("_gp");
+    assert(gpAtomIter != _mipsTargetLayout.absoluteAtoms().end());
+    (*gpAtomIter)->_virtualAddr = gp;
+
+    AtomLayout *gpAtom = _mipsTargetLayout.getGP();
+    assert(gpAtom != nullptr);
+    gpAtom->_virtualAddr = gp;
   }
 
   bool hasGlobalGOTEntry(const Atom *a) const {





More information about the llvm-commits mailing list