[lld] r196883 - Style fixes. No functionality change.
Rui Ueyama
ruiu at google.com
Mon Dec 9 22:19:09 PST 2013
Author: ruiu
Date: Tue Dec 10 00:19:09 2013
New Revision: 196883
URL: http://llvm.org/viewvc/llvm-project?rev=196883&view=rev
Log:
Style fixes. No functionality change.
Modified:
lld/trunk/lib/Core/Resolver.cpp
lld/trunk/lib/Passes/GOTPass.cpp
lld/trunk/lib/Passes/LayoutPass.cpp
Modified: lld/trunk/lib/Core/Resolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Resolver.cpp?rev=196883&r1=196882&r2=196883&view=diff
==============================================================================
--- lld/trunk/lib/Core/Resolver.cpp (original)
+++ lld/trunk/lib/Core/Resolver.cpp Tue Dec 10 00:19:09 2013
@@ -41,10 +41,9 @@ public:
if (_liveAtoms.count(atom))
return false;
// don't remove if marked never-dead-strip
- if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom)) {
+ if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom))
if (defAtom->deadStrip() == DefinedAtom::deadStripNever)
return false;
- }
// do remove this atom
return true;
}
@@ -249,16 +248,14 @@ void Resolver::doAbsoluteAtom(const Abso
_atoms.push_back(&atom);
// tell symbol table
- if (atom.scope() != Atom::scopeTranslationUnit) {
+ if (atom.scope() != Atom::scopeTranslationUnit)
_symbolTable.add(atom);
- }
}
// utility to add a vector of atoms
void Resolver::addAtoms(const std::vector<const DefinedAtom *> &newAtoms) {
- for (const DefinedAtom *newAtom : newAtoms) {
+ for (const DefinedAtom *newAtom : newAtoms)
this->doDefinedAtom(*newAtom);
- }
}
// Keep adding atoms until _context.nextFile() returns an error. This function
@@ -363,9 +360,8 @@ void Resolver::deadStripOptimize() {
}
// mark all roots as live, and recursively all atoms they reference
- for (const Atom *dsrAtom : _deadStripRoots) {
+ for (const Atom *dsrAtom : _deadStripRoots)
this->markLive(*dsrAtom);
- }
// now remove all non-live atoms from _atoms
_atoms.erase(
@@ -443,10 +439,9 @@ bool Resolver::resolve() {
return false;
this->updateReferences();
this->deadStripOptimize();
- if (this->checkUndefines(false)) {
+ if (this->checkUndefines(false))
if (!_context.allowRemainingUndefines())
return false;
- }
this->removeCoalescedAwayAtoms();
this->linkTimeOptimize();
this->_result->addAtoms(_atoms);
Modified: lld/trunk/lib/Passes/GOTPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/GOTPass.cpp?rev=196883&r1=196882&r2=196883&view=diff
==============================================================================
--- lld/trunk/lib/Passes/GOTPass.cpp (original)
+++ lld/trunk/lib/Passes/GOTPass.cpp Tue Dec 10 00:19:09 2013
@@ -100,8 +100,8 @@ void GOTPass::perform(std::unique_ptr<Mu
}
// add all created GOT Atoms to master file
- for (auto &it : targetToGOT) {
+ for (auto &it : targetToGOT)
mergedFile->addAtom(*it.second);
- }
-}
}
+
+} // end namesapce lld
Modified: lld/trunk/lib/Passes/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/LayoutPass.cpp?rev=196883&r1=196882&r2=196883&view=diff
==============================================================================
--- lld/trunk/lib/Passes/LayoutPass.cpp (original)
+++ lld/trunk/lib/Passes/LayoutPass.cpp Tue Dec 10 00:19:09 2013
@@ -416,19 +416,17 @@ void LayoutPass::buildInGroupTable(Mutab
// Check if the current atom is part of the chain
bool isAtomInChain = false;
const DefinedAtom *lastAtom = rootAtom;
- while (true) {
+ for (;;) {
AtomToAtomT::iterator followOnAtomsIter =
- _followOnNexts.find(lastAtom);
+ _followOnNexts.find(lastAtom);
if (followOnAtomsIter != _followOnNexts.end()) {
lastAtom = followOnAtomsIter->second;
- if (lastAtom == ai) {
- isAtomInChain = true;
- break;
- }
+ if (lastAtom != ai)
+ continue;
+ isAtomInChain = true;
}
- else
- break;
- } // findAtomInChain
+ break;
+ }
if (!isAtomInChain)
_followOnNexts[lastAtom] = ai;
@@ -517,9 +515,8 @@ void LayoutPass::buildOrdinalOverrideMap
for (const DefinedAtom *nextAtom = start->second; nextAtom != NULL;
nextAtom = _followOnNexts[nextAtom]) {
AtomToOrdinalT::iterator pos = _ordinalOverrideMap.find(nextAtom);
- if (pos == _ordinalOverrideMap.end()) {
+ if (pos == _ordinalOverrideMap.end())
_ordinalOverrideMap[nextAtom] = index++;
- }
}
}
}
More information about the llvm-commits
mailing list