From 95be0d014a87607b79a32aa2852d539f853509a2 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 3 Jun 2014 07:43:15 +0000 Subject: [PATCH] Use auto for obvious types. llvm-svn: 210085 --- lld/include/lld/ReaderWriter/Simple.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lld/include/lld/ReaderWriter/Simple.h b/lld/include/lld/ReaderWriter/Simple.h index b118f86..03e8783 100644 --- a/lld/include/lld/ReaderWriter/Simple.h +++ b/lld/include/lld/ReaderWriter/Simple.h @@ -26,16 +26,14 @@ public: SimpleFile(StringRef path) : MutableFile(path) {} void addAtom(const Atom &atom) override { - if (const DefinedAtom *defAtom = dyn_cast(&atom)) { + if (auto *defAtom = dyn_cast(&atom)) { _definedAtoms._atoms.push_back(defAtom); - } else if ( - const UndefinedAtom *undefAtom = dyn_cast(&atom)) { + } else if (auto *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); + } else if (auto *shlibAtom = dyn_cast(&atom)) { + _sharedLibraryAtoms._atoms.push_back(shlibAtom); + } else if (auto *absAtom = dyn_cast(&atom)) { + _absoluteAtoms._atoms.push_back(absAtom); } else { llvm_unreachable("atom has unknown definition kind"); } -- 2.7.4