forked from OSchip/llvm-project
parent
99c68dd964
commit
20231f1275
|
@ -360,7 +360,7 @@ public:
|
||||||
delete _sharedLibraryAtoms._arrayStart;
|
delete _sharedLibraryAtoms._arrayStart;
|
||||||
delete _absoluteAtoms._arrayStart;
|
delete _absoluteAtoms._arrayStart;
|
||||||
delete _references.arrayStart;
|
delete _references.arrayStart;
|
||||||
delete _targetsTable;
|
delete [] _targetsTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const atom_collection<DefinedAtom>& defined() const {
|
virtual const atom_collection<DefinedAtom>& defined() const {
|
||||||
|
|
|
@ -167,7 +167,7 @@ private:
|
||||||
// We want _stringCopies to own the string memory so it is deallocated
|
// We want _stringCopies to own the string memory so it is deallocated
|
||||||
// when the File object is destroyed. But we need a StringRef that
|
// when the File object is destroyed. But we need a StringRef that
|
||||||
// points into that memory.
|
// points into that memory.
|
||||||
std::unique_ptr<char> s = std::unique_ptr<char>(new char[str.size()]);
|
std::unique_ptr<char[]> s(new char[str.size()]);
|
||||||
memcpy(s.get(), str.data(), str.size());
|
memcpy(s.get(), str.data(), str.size());
|
||||||
llvm::StringRef r = llvm::StringRef(s.get(), str.size());
|
llvm::StringRef r = llvm::StringRef(s.get(), str.size());
|
||||||
_stringCopies.push_back(std::move(s));
|
_stringCopies.push_back(std::move(s));
|
||||||
|
@ -178,7 +178,7 @@ private:
|
||||||
unsigned int _unnamedCounter;
|
unsigned int _unnamedCounter;
|
||||||
NameToAtom _nameMap;
|
NameToAtom _nameMap;
|
||||||
AtomToRefName _refNames;
|
AtomToRefName _refNames;
|
||||||
std::vector<std::unique_ptr<char>> _stringCopies;
|
std::vector<std::unique_ptr<char[]>> _stringCopies;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -706,7 +706,7 @@ struct MappingTraits<const lld::File*> {
|
||||||
// We want _stringCopies to own the string memory so it is deallocated
|
// We want _stringCopies to own the string memory so it is deallocated
|
||||||
// when the File object is destroyed. But we need a StringRef that
|
// when the File object is destroyed. But we need a StringRef that
|
||||||
// points into that memory.
|
// points into that memory.
|
||||||
std::unique_ptr<char> s = std::unique_ptr<char>(new char[str.size()]);
|
std::unique_ptr<char[]> s(new char[str.size()]);
|
||||||
memcpy(s.get(), str.data(), str.size());
|
memcpy(s.get(), str.data(), str.size());
|
||||||
llvm::StringRef r = llvm::StringRef(s.get(), str.size());
|
llvm::StringRef r = llvm::StringRef(s.get(), str.size());
|
||||||
_stringCopies.push_back(std::move(s));
|
_stringCopies.push_back(std::move(s));
|
||||||
|
@ -720,7 +720,7 @@ struct MappingTraits<const lld::File*> {
|
||||||
AtomList<lld::UndefinedAtom> _undefinedAtoms;
|
AtomList<lld::UndefinedAtom> _undefinedAtoms;
|
||||||
AtomList<lld::SharedLibraryAtom> _sharedLibraryAtoms;
|
AtomList<lld::SharedLibraryAtom> _sharedLibraryAtoms;
|
||||||
AtomList<lld::AbsoluteAtom> _absoluteAtoms;
|
AtomList<lld::AbsoluteAtom> _absoluteAtoms;
|
||||||
std::vector<std::unique_ptr<char>> _stringCopies;
|
std::vector<std::unique_ptr<char[]>> _stringCopies;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue