2020
2121using namespace llvm ;
2222using namespace llvm ::codeview;
23-
24- namespace lld {
25- namespace coff {
23+ using namespace lld ;
24+ using namespace lld ::coff;
2625
2726namespace {
2827// The TypeServerSource class represents a PDB type server, a file referenced by
@@ -94,25 +93,27 @@ class UsePrecompSource : public TpiSource {
9493
9594TpiSource::TpiSource (TpiKind k, const ObjFile *f) : kind(k), file(f) {}
9695
97- TpiSource *makeTpiSource (const ObjFile *f) {
96+ TpiSource *lld::coff:: makeTpiSource (const ObjFile *f) {
9897 return make<TpiSource>(TpiSource::Regular, f);
9998}
10099
101- TpiSource *makeUseTypeServerSource (const ObjFile *f,
100+ TpiSource *lld::coff:: makeUseTypeServerSource (const ObjFile *f,
102101 const TypeServer2Record *ts) {
103102 TypeServerSource::enqueue (f, *ts);
104103 return make<UseTypeServerSource>(f, ts);
105104}
106105
107- TpiSource *makePrecompSource (const ObjFile *f) {
106+ TpiSource *lld::coff:: makePrecompSource (const ObjFile *f) {
108107 return make<PrecompSource>(f);
109108}
110109
111- TpiSource *makeUsePrecompSource (const ObjFile *f,
110+ TpiSource *lld::coff:: makeUsePrecompSource (const ObjFile *f,
112111 const PrecompRecord *precomp) {
113112 return make<UsePrecompSource>(f, precomp);
114113}
115114
115+ namespace lld {
116+ namespace coff {
116117template <>
117118const PrecompRecord &retrieveDependencyInfo (const TpiSource *source) {
118119 assert (source->kind == TpiSource::UsingPCH);
@@ -124,6 +125,8 @@ const TypeServer2Record &retrieveDependencyInfo(const TpiSource *source) {
124125 assert (source->kind == TpiSource::UsingPDB);
125126 return ((const UseTypeServerSource *)source)->typeServerDependency ;
126127}
128+ } // namespace coff
129+ } // namespace lld
127130
128131std::map<std::string, std::pair<std::string, TypeServerSource *>>
129132 TypeServerSource::instances;
@@ -204,7 +207,8 @@ TypeServerSource::findFromFile(const ObjFile *dependentFile) {
204207
205208// FIXME: Temporary interface until PDBLinker::maybeMergeTypeServerPDB() is
206209// moved here.
207- Expected<llvm::pdb::NativeSession *> findTypeServerSource (const ObjFile *f) {
210+ Expected<llvm::pdb::NativeSession *>
211+ lld::coff::findTypeServerSource (const ObjFile *f) {
208212 Expected<TypeServerSource *> ts = TypeServerSource::findFromFile (f);
209213 if (!ts)
210214 return ts.takeError ();
@@ -232,7 +236,7 @@ void TypeServerSource::enqueue(const ObjFile *dependentFile,
232236// will be merged in. NOTE - a PDB load failure is not a link error: some
233237// debug info will simply be missing from the final PDB - that is the default
234238// accepted behavior.
235- void loadTypeServerSource (llvm::MemoryBufferRef m) {
239+ void lld::coff:: loadTypeServerSource (llvm::MemoryBufferRef m) {
236240 std::string path = normalizePdbPath (m.getBufferIdentifier ());
237241
238242 Expected<TypeServerSource *> ts = TypeServerSource::getInstance (m);
@@ -259,6 +263,3 @@ Expected<TypeServerSource *> TypeServerSource::getInstance(MemoryBufferRef m) {
259263 return info.takeError ();
260264 return make<TypeServerSource>(m, session.release ());
261265}
262-
263- } // namespace coff
264- } // namespace lld
0 commit comments