Simplify another function that doesn't fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238703 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-06-01 00:27:26 +00:00
parent 75ce6bba4e
commit 481f35f113
14 changed files with 31 additions and 48 deletions

View File

@@ -387,8 +387,7 @@ void RuntimeDyldImpl::computeTotalAllocSize(const ObjectFile &Obj,
uint32_t Flags = I->getFlags();
if (Flags & SymbolRef::SF_Common) {
// Add the common symbols to a list. We'll allocate them all below.
uint64_t Size = 0;
Check(I->getSize(Size));
uint64_t Size = I->getSize();
CommonSize += Size;
}
}
@@ -495,8 +494,7 @@ void RuntimeDyldImpl::emitCommonSymbols(const ObjectFile &Obj,
}
uint32_t Align = Sym.getAlignment();
uint64_t Size = 0;
Check(Sym.getSize(Size));
uint64_t Size = Sym.getSize();
CommonSize += Align + Size;
SymbolsToAllocate.push_back(Sym);
@@ -518,9 +516,8 @@ void RuntimeDyldImpl::emitCommonSymbols(const ObjectFile &Obj,
// Assign the address of each symbol
for (auto &Sym : SymbolsToAllocate) {
uint32_t Align = Sym.getAlignment();
uint64_t Size;
StringRef Name;
Check(Sym.getSize(Size));
uint64_t Size = Sym.getSize();
Check(Sym.getName(Name));
if (Align) {
// This symbol has an alignment requirement.