mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Simplify code.
We can delete the objects earlier now that we are copying the names to a buffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211221 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
889069443b
commit
d8fc64e0d1
@ -692,7 +692,6 @@ static void writeSymbolTable(
|
||||
std::string NameBuf;
|
||||
raw_string_ostream NameOS(NameBuf);
|
||||
unsigned NumSyms = 0;
|
||||
std::vector<object::SymbolicFile *> DeleteIt;
|
||||
LLVMContext &Context = getGlobalContext();
|
||||
for (ArrayRef<NewArchiveIterator>::iterator I = Members.begin(),
|
||||
E = Members.end();
|
||||
@ -703,9 +702,8 @@ static void writeSymbolTable(
|
||||
MemberBuffer, false, sys::fs::file_magic::unknown, &Context);
|
||||
if (!ObjOrErr)
|
||||
continue; // FIXME: check only for "not an object file" errors.
|
||||
object::SymbolicFile *Obj = ObjOrErr.get();
|
||||
std::unique_ptr<object::SymbolicFile> Obj(ObjOrErr.get());
|
||||
|
||||
DeleteIt.push_back(Obj);
|
||||
if (!StartOffset) {
|
||||
printMemberHeader(Out, "", sys::TimeValue::now(), 0, 0, 0, 0);
|
||||
StartOffset = Out.tell();
|
||||
@ -731,13 +729,6 @@ static void writeSymbolTable(
|
||||
}
|
||||
Out << NameOS.str();
|
||||
|
||||
for (std::vector<object::SymbolicFile *>::iterator I = DeleteIt.begin(),
|
||||
E = DeleteIt.end();
|
||||
I != E; ++I) {
|
||||
object::SymbolicFile *O = *I;
|
||||
delete O;
|
||||
}
|
||||
|
||||
if (StartOffset == 0)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user