From 251e68b6aef5607fec853658cdc416ba2cd7ade4 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 18 Jan 2014 00:38:44 +0000 Subject: [PATCH] Use auto for readability. No functionality change. llvm-svn: 199527 --- lld/lib/Core/Resolver.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp index 33c9008f764b..64503fa5b586 100644 --- a/lld/lib/Core/Resolver.cpp +++ b/lld/lib/Core/Resolver.cpp @@ -439,15 +439,14 @@ bool Resolver::resolve() { } void Resolver::MergedFile::addAtom(const Atom &atom) { - if (const DefinedAtom *defAtom = dyn_cast(&atom)) { - _definedAtoms._atoms.push_back(defAtom); - } else if (const UndefinedAtom *undefAtom = dyn_cast(&atom)) { - _undefinedAtoms._atoms.push_back(undefAtom); - } else if (const SharedLibraryAtom *slAtom = - dyn_cast(&atom)) { - _sharedLibraryAtoms._atoms.push_back(slAtom); - } else if (const AbsoluteAtom *abAtom = dyn_cast(&atom)) { - _absoluteAtoms._atoms.push_back(abAtom); + if (auto *def = dyn_cast(&atom)) { + _definedAtoms._atoms.push_back(def); + } else if (auto *undef = dyn_cast(&atom)) { + _undefinedAtoms._atoms.push_back(undef); + } else if (auto *shared = dyn_cast(&atom)) { + _sharedLibraryAtoms._atoms.push_back(shared); + } else if (auto *abs = dyn_cast(&atom)) { + _absoluteAtoms._atoms.push_back(abs); } else { llvm_unreachable("atom has unknown definition kind"); }