diff --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp --- a/lld/COFF/DebugTypes.cpp +++ b/lld/COFF/DebugTypes.cpp @@ -10,6 +10,7 @@ #include "Driver.h" #include "InputFiles.h" #include "lld/Common/ErrorHandler.h" +#include "lld/Common/Memory.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/DebugInfo/PDB/GenericError.h" #include "llvm/DebugInfo/PDB/Native/InfoStream.h" @@ -91,29 +92,25 @@ }; } // namespace -static std::vector> GC; - -TpiSource::TpiSource(TpiKind k, const ObjFile *f) : kind(k), file(f) { - GC.push_back(std::unique_ptr(this)); -} +TpiSource::TpiSource(TpiKind k, const ObjFile *f) : kind(k), file(f) {} TpiSource *makeTpiSource(const ObjFile *f) { - return new TpiSource(TpiSource::Regular, f); + return make(TpiSource::Regular, f); } TpiSource *makeUseTypeServerSource(const ObjFile *f, const TypeServer2Record *ts) { TypeServerSource::enqueue(f, *ts); - return new UseTypeServerSource(f, ts); + return make(f, ts); } TpiSource *makePrecompSource(const ObjFile *f) { - return new PrecompSource(f); + return make(f); } TpiSource *makeUsePrecompSource(const ObjFile *f, const PrecompRecord *precomp) { - return new UsePrecompSource(f, precomp); + return make(f, precomp); } template <> @@ -260,7 +257,7 @@ // All PDB Files should have an Info stream. if (!info) return info.takeError(); - return new TypeServerSource(m, session.release()); + return make(m, session.release()); } } // namespace coff