diff options
author | Rui Ueyama <ruiu@google.com> | 2014-04-04 18:21:51 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2014-04-04 18:21:51 +0000 |
commit | 01cc71837504121f8e7cdb6b57b532341e577af9 (patch) | |
tree | 261c0277c46badae35a89022b1d8072619d50ccf /lld/lib/Core/SymbolTable.cpp | |
parent | d20deac32d909425440a765879a11386bc5b60a7 (diff) | |
download | bcm5719-llvm-01cc71837504121f8e7cdb6b57b532341e577af9.tar.gz bcm5719-llvm-01cc71837504121f8e7cdb6b57b532341e577af9.zip |
Replace dyn_cast<T>s immediately followed by asserts with cast<T>s.
llvm-svn: 205641
Diffstat (limited to 'lld/lib/Core/SymbolTable.cpp')
-rw-r--r-- | lld/lib/Core/SymbolTable.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lld/lib/Core/SymbolTable.cpp b/lld/lib/Core/SymbolTable.cpp index 475c71efefe..aa35c158737 100644 --- a/lld/lib/Core/SymbolTable.cpp +++ b/lld/lib/Core/SymbolTable.cpp @@ -225,10 +225,8 @@ void SymbolTable::addByName(const Atom &newAtom) { } break; case NCR_DupUndef: { - const UndefinedAtom* existingUndef = dyn_cast<UndefinedAtom>(existing); - const UndefinedAtom* newUndef = dyn_cast<UndefinedAtom>(&newAtom); - assert(existingUndef != nullptr); - assert(newUndef != nullptr); + const UndefinedAtom* existingUndef = cast<UndefinedAtom>(existing); + const UndefinedAtom* newUndef = cast<UndefinedAtom>(&newAtom); bool sameCanBeNull = (existingUndef->canBeNull() == newUndef->canBeNull()); if (!sameCanBeNull && @@ -262,10 +260,8 @@ void SymbolTable::addByName(const Atom &newAtom) { break; } case NCR_DupShLib: { - const SharedLibraryAtom *curShLib = dyn_cast<SharedLibraryAtom>(existing); - const SharedLibraryAtom *newShLib = dyn_cast<SharedLibraryAtom>(&newAtom); - assert(curShLib != nullptr); - assert(newShLib != nullptr); + const SharedLibraryAtom *curShLib = cast<SharedLibraryAtom>(existing); + const SharedLibraryAtom *newShLib = cast<SharedLibraryAtom>(&newAtom); bool sameNullness = (curShLib->canBeNullAtRuntime() == newShLib->canBeNullAtRuntime()); bool sameName = curShLib->loadName().equals(newShLib->loadName()); @@ -330,7 +326,6 @@ bool SymbolTable::AtomMappingInfo::isEqual(const DefinedAtom * const l, return false; if (r == getTombstoneKey()) return false; - if (l->contentType() != r->contentType()) return false; if (l->size() != r->size()) |