llvm.org GIT mirror llvm / dbba2eb
Fix c++03 build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200042 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
1 changed file(s) with 12 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
691691
692692 static void writeSymbolTable(
693693 raw_fd_ostream &Out, ArrayRef Members,
694 ArrayRef<OwningPtr > Buffers,
694 ArrayRef<MemoryBuffer *> Buffers,
695695 std::vector > &MemberOffsetRefs) {
696696 unsigned StartOffset = 0;
697697 unsigned MemberNum = 0;
700700 for (ArrayRef::iterator I = Members.begin(),
701701 E = Members.end();
702702 I != E; ++I, ++MemberNum) {
703 const OwningPtr &MemberBuffer = Buffers[MemberNum];
703 MemoryBuffer *MemberBuffer = Buffers[MemberNum];
704704 ErrorOr ObjOrErr =
705 object::ObjectFile::createObjectFile(MemberBuffer.get(), false);
705 object::ObjectFile::createObjectFile(MemberBuffer, false);
706706 if (!ObjOrErr)
707707 continue; // FIXME: check only for "not an object file" errors.
708708 object::ObjectFile *Obj = ObjOrErr.get();
777777
778778 std::vector > MemberOffsetRefs;
779779
780 std::vector<OwningPtr > MemberBuffers;
780 std::vector<MemoryBuffer *> MemberBuffers;
781781 MemberBuffers.resize(NewMembers.size());
782782
783783 for (unsigned I = 0, N = NewMembers.size(); I < N; ++I) {
784 OwningPtr &MemberBuffer = MemberBuffers[I];
784 OwningPtr MemberBuffer;
785785 NewArchiveIterator &Member = NewMembers[I];
786786
787787 if (Member.isNewMember()) {
796796 object::Archive::child_iterator OldMember = Member.getOld();
797797 failIfError(OldMember->getMemoryBuffer(MemberBuffer));
798798 }
799 MemberBuffers[I] = MemberBuffer.take();
799800 }
800801
801802 if (Symtab) {
823824 }
824825 Out.seek(Pos);
825826
826 const OwningPtr &File = MemberBuffers[MemberNum];
827 const MemoryBuffer *File = MemberBuffers[MemberNum];
827828 if (I->isNewMember()) {
828829 const char *FileName = I->getNew();
829830 const sys::fs::file_status &Status = I->getStatus();
858859 if (Out.tell() % 2)
859860 Out << '\n';
860861 }
862
863 for (unsigned I = 0, N = MemberBuffers.size(); I < N; ++I) {
864 delete MemberBuffers[I];
865 }
866
861867 Output.keep();
862868 Out.close();
863869 sys::fs::rename(TemporaryOutput, ArchiveName);