[lld] r210085 - Use auto for obvious types.
Rui Ueyama
ruiu at google.com
Tue Jun 3 00:43:15 PDT 2014
Author: ruiu
Date: Tue Jun 3 02:43:15 2014
New Revision: 210085
URL: http://llvm.org/viewvc/llvm-project?rev=210085&view=rev
Log:
Use auto for obvious types.
Modified:
lld/trunk/include/lld/ReaderWriter/Simple.h
Modified: lld/trunk/include/lld/ReaderWriter/Simple.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/Simple.h?rev=210085&r1=210084&r2=210085&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/Simple.h (original)
+++ lld/trunk/include/lld/ReaderWriter/Simple.h Tue Jun 3 02:43:15 2014
@@ -26,16 +26,14 @@ public:
SimpleFile(StringRef path) : MutableFile(path) {}
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);
- } else if (
- const UndefinedAtom *undefAtom = dyn_cast<UndefinedAtom>(&atom)) {
+ } else if (auto *undefAtom = dyn_cast<UndefinedAtom>(&atom)) {
_undefinedAtoms._atoms.push_back(undefAtom);
- } else if (
- const SharedLibraryAtom *slAtom = dyn_cast<SharedLibraryAtom>(&atom)) {
- _sharedLibraryAtoms._atoms.push_back(slAtom);
- } else if (const AbsoluteAtom *abAtom = dyn_cast<AbsoluteAtom>(&atom)) {
- _absoluteAtoms._atoms.push_back(abAtom);
+ } else if (auto *shlibAtom = dyn_cast<SharedLibraryAtom>(&atom)) {
+ _sharedLibraryAtoms._atoms.push_back(shlibAtom);
+ } else if (auto *absAtom = dyn_cast<AbsoluteAtom>(&atom)) {
+ _absoluteAtoms._atoms.push_back(absAtom);
} else {
llvm_unreachable("atom has unknown definition kind");
}
More information about the llvm-commits
mailing list