1717#include " llvm/DebugInfo/PDB/Native/PDBFile.h"
1818#include " llvm/Support/Path.h"
1919
20- using namespace lld ;
21- using namespace lld ::coff;
2220using namespace llvm ;
2321using namespace llvm ::codeview;
2422
23+ namespace lld {
24+ namespace coff {
25+
2526namespace {
2627// The TypeServerSource class represents a PDB type server, a file referenced by
2728// OBJ files compiled with MSVC /Zi. A single PDB can be shared by several OBJ
@@ -96,27 +97,25 @@ TpiSource::TpiSource(TpiKind k, const ObjFile *f) : kind(k), file(f) {
9697 GC.push_back (std::unique_ptr<TpiSource>(this ));
9798}
9899
99- TpiSource *lld::coff:: makeTpiSource (const ObjFile *f) {
100+ TpiSource *makeTpiSource (const ObjFile *f) {
100101 return new TpiSource (TpiSource::Regular, f);
101102}
102103
103- TpiSource *lld::coff:: makeUseTypeServerSource (const ObjFile *f,
104+ TpiSource *makeUseTypeServerSource (const ObjFile *f,
104105 const TypeServer2Record *ts) {
105106 TypeServerSource::enqueue (f, *ts);
106107 return new UseTypeServerSource (f, ts);
107108}
108109
109- TpiSource *lld::coff:: makePrecompSource (const ObjFile *f) {
110+ TpiSource *makePrecompSource (const ObjFile *f) {
110111 return new PrecompSource (f);
111112}
112113
113- TpiSource *lld::coff:: makeUsePrecompSource (const ObjFile *f,
114+ TpiSource *makeUsePrecompSource (const ObjFile *f,
114115 const PrecompRecord *precomp) {
115116 return new UsePrecompSource (f, precomp);
116117}
117118
118- namespace lld {
119- namespace coff {
120119template <>
121120const PrecompRecord &retrieveDependencyInfo (const TpiSource *source) {
122121 assert (source->kind == TpiSource::UsingPCH);
@@ -128,8 +127,6 @@ const TypeServer2Record &retrieveDependencyInfo(const TpiSource *source) {
128127 assert (source->kind == TpiSource::UsingPDB);
129128 return ((const UseTypeServerSource *)source)->typeServerDependency ;
130129}
131- } // namespace coff
132- } // namespace lld
133130
134131std::map<std::string, std::pair<std::string, TypeServerSource *>>
135132 TypeServerSource::instances;
@@ -210,8 +207,7 @@ TypeServerSource::findFromFile(const ObjFile *dependentFile) {
210207
211208// FIXME: Temporary interface until PDBLinker::maybeMergeTypeServerPDB() is
212209// moved here.
213- Expected<llvm::pdb::NativeSession *>
214- lld::coff::findTypeServerSource (const ObjFile *f) {
210+ Expected<llvm::pdb::NativeSession *> findTypeServerSource (const ObjFile *f) {
215211 Expected<TypeServerSource *> ts = TypeServerSource::findFromFile (f);
216212 if (!ts)
217213 return ts.takeError ();
@@ -239,7 +235,7 @@ void TypeServerSource::enqueue(const ObjFile *dependentFile,
239235// will be merged in. NOTE - a PDB load failure is not a link error: some
240236// debug info will simply be missing from the final PDB - that is the default
241237// accepted behavior.
242- void lld::coff:: loadTypeServerSource (llvm::MemoryBufferRef m) {
238+ void loadTypeServerSource (llvm::MemoryBufferRef m) {
243239 std::string path = normalizePdbPath (m.getBufferIdentifier ());
244240
245241 Expected<TypeServerSource *> ts = TypeServerSource::getInstance (m);
@@ -266,3 +262,6 @@ Expected<TypeServerSource *> TypeServerSource::getInstance(MemoryBufferRef m) {
266262 return info.takeError ();
267263 return new TypeServerSource (m, session.release ());
268264}
265+
266+ } // namespace coff
267+ } // namespace lld
0 commit comments