Use auto for obvious types.

llvm-svn: 210085
This commit is contained in:
Rui Ueyama 2014-06-03 07:43:15 +00:00
parent 9ef8a9c94b
commit 95be0d014a
1 changed files with 6 additions and 8 deletions

View File

@ -26,16 +26,14 @@ public:
SimpleFile(StringRef path) : MutableFile(path) {} SimpleFile(StringRef path) : MutableFile(path) {}
void addAtom(const Atom &atom) override { void addAtom(const Atom &atom) override {
if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(&atom)) { if (auto *defAtom = dyn_cast<DefinedAtom>(&atom)) {
_definedAtoms._atoms.push_back(defAtom); _definedAtoms._atoms.push_back(defAtom);
} else if ( } else if (auto *undefAtom = dyn_cast<UndefinedAtom>(&atom)) {
const UndefinedAtom *undefAtom = dyn_cast<UndefinedAtom>(&atom)) {
_undefinedAtoms._atoms.push_back(undefAtom); _undefinedAtoms._atoms.push_back(undefAtom);
} else if ( } else if (auto *shlibAtom = dyn_cast<SharedLibraryAtom>(&atom)) {
const SharedLibraryAtom *slAtom = dyn_cast<SharedLibraryAtom>(&atom)) { _sharedLibraryAtoms._atoms.push_back(shlibAtom);
_sharedLibraryAtoms._atoms.push_back(slAtom); } else if (auto *absAtom = dyn_cast<AbsoluteAtom>(&atom)) {
} else if (const AbsoluteAtom *abAtom = dyn_cast<AbsoluteAtom>(&atom)) { _absoluteAtoms._atoms.push_back(absAtom);
_absoluteAtoms._atoms.push_back(abAtom);
} else { } else {
llvm_unreachable("atom has unknown definition kind"); llvm_unreachable("atom has unknown definition kind");
} }