[lld] r197201 - [PECOFF] Rename lld::coff -> lld::pecoff.
Rui Ueyama
ruiu at google.com
Thu Dec 12 18:58:28 PST 2013
Author: ruiu
Date: Thu Dec 12 20:58:27 2013
New Revision: 197201
URL: http://llvm.org/viewvc/llvm-project?rev=197201&view=rev
Log:
[PECOFF] Rename lld::coff -> lld::pecoff.
We had lld::coff and lld::pecoff namespaces for no reason. Unify them.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp
lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h
lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
lld/trunk/lib/ReaderWriter/PECOFF/Pass.cpp
lld/trunk/lib/ReaderWriter/PECOFF/Pass.h
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.h
Modified: lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h Thu Dec 12 20:58:27 2013
@@ -18,7 +18,7 @@
#include <vector>
namespace lld {
-namespace coff {
+namespace pecoff {
class COFFDefinedAtom;
/// A COFFReference represents relocation information for an atom. For
@@ -372,7 +372,7 @@ template <typename T> void connectAtomsW
connectWithLayoutEdge(*it, *(it + 1));
}
-} // namespace coff
+} // namespace pecoff
} // namespace lld
#endif
Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp Thu Dec 12 20:58:27 2013
@@ -75,9 +75,9 @@ void ImportDirectoryAtom::addRelocations
offsetof(ImportDirectoryTableEntry, ImportLookupTableRVA));
addDir32NBReloc(this, importAddressTables[0],
offsetof(ImportDirectoryTableEntry, ImportAddressTableRVA));
- auto *atom = new (_alloc) coff::COFFStringAtom(
- context.dummyFile, context.dummyFile.getNextOrdinal(), ".idata",
- loadName);
+ auto *atom = new (_alloc)
+ COFFStringAtom(context.dummyFile, context.dummyFile.getNextOrdinal(),
+ ".idata", loadName);
context.file.addAtom(*atom);
addDir32NBReloc(this, atom, offsetof(ImportDirectoryTableEntry, NameRVA));
}
Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h Thu Dec 12 20:58:27 2013
@@ -29,12 +29,6 @@
#include <algorithm>
#include <map>
-using lld::coff::COFFBaseDefinedAtom;
-using lld::coff::COFFDefinedAtom;
-using lld::coff::COFFLinkerInternalAtom;
-using lld::coff::COFFReference;
-using lld::coff::COFFSharedLibraryAtom;
-using lld::coff::COFFSharedLibraryAtom;
using llvm::COFF::ImportDirectoryTableEntry;
namespace lld {
@@ -47,9 +41,9 @@ class ImportTableEntryAtom;
// A state object of this pass.
struct Context {
-Context(MutableFile &f, coff::VirtualFile &g) : file(f), dummyFile(g) {}
+ Context(MutableFile &f, VirtualFile &g) : file(f), dummyFile(g) {}
MutableFile &file;
- coff::VirtualFile &dummyFile;
+ VirtualFile &dummyFile;
};
/// The root class of all idata atoms.
@@ -150,7 +144,7 @@ private:
// A dummy file with which all the atoms created in the pass will be
// associated. Atoms need to be associated to an input file even if it's not
// read from a file, so we use this object.
- coff::VirtualFile _dummyFile;
+ VirtualFile _dummyFile;
llvm::BumpPtrAllocator _alloc;
};
Modified: lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h Thu Dec 12 20:58:27 2013
@@ -13,7 +13,7 @@
#include "lld/ReaderWriter/Simple.h"
namespace lld {
-namespace coff {
+namespace pecoff {
// A virtual file containing absolute symbol __ImageBase. __ImageBase (or
// ___ImageBase on x86) is a linker-generated symbol whose address is the same
@@ -31,5 +31,5 @@ private:
COFFAbsoluteAtom _imageBaseAtom;
};
-} // end namespace coff
+} // end namespace pecoff
} // end namespace lld
Modified: lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp Thu Dec 12 20:58:27 2013
@@ -96,7 +96,7 @@ bool PECOFFLinkingContext::createImplici
std::unique_ptr<SimpleFileNode> fileNode(
new SimpleFileNode("Implicit Files"));
std::unique_ptr<File> linkerGeneratedSymFile(
- new coff::LinkerGeneratedSymbolFile(*this));
+ new pecoff::LinkerGeneratedSymbolFile(*this));
fileNode->appendInputFile(std::move(linkerGeneratedSymFile));
inputGraph().insertOneElementAt(std::move(fileNode),
InputGraph::Position::END);
@@ -253,4 +253,5 @@ void PECOFFLinkingContext::addPasses(Pas
pm.add(std::unique_ptr<Pass>(new LayoutPass()));
pm.add(std::unique_ptr<Pass>(new pecoff::GroupedSectionsPass()));
}
+
} // end namespace lld
Modified: lld/trunk/lib/ReaderWriter/PECOFF/Pass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/Pass.cpp?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/Pass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/Pass.cpp Thu Dec 12 20:58:27 2013
@@ -16,9 +16,9 @@
namespace lld {
namespace pecoff {
-void addDir32NBReloc(coff::COFFBaseDefinedAtom *atom, const Atom *target,
+void addDir32NBReloc(COFFBaseDefinedAtom *atom, const Atom *target,
size_t offsetInAtom) {
- std::unique_ptr<coff::COFFReference> ref(new coff::COFFReference(
+ std::unique_ptr<COFFReference> ref(new COFFReference(
target, offsetInAtom, llvm::COFF::IMAGE_REL_I386_DIR32NB));
atom->addReference(std::move(ref));
}
Modified: lld/trunk/lib/ReaderWriter/PECOFF/Pass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/Pass.h?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/Pass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/Pass.h Thu Dec 12 20:58:27 2013
@@ -15,7 +15,7 @@
namespace lld {
namespace pecoff {
-void addDir32NBReloc(coff::COFFBaseDefinedAtom *atom, const Atom *target,
+void addDir32NBReloc(COFFBaseDefinedAtom *atom, const Atom *target,
size_t offsetInAtom = 0);
} // namespace pecoff
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Thu Dec 12 20:58:27 2013
@@ -37,12 +37,12 @@
#include <vector>
using std::vector;
-using lld::coff::COFFAbsoluteAtom;
-using lld::coff::COFFBSSAtom;
-using lld::coff::COFFDefinedAtom;
-using lld::coff::COFFDefinedFileAtom;
-using lld::coff::COFFReference;
-using lld::coff::COFFUndefinedAtom;
+using lld::pecoff::COFFAbsoluteAtom;
+using lld::pecoff::COFFBSSAtom;
+using lld::pecoff::COFFDefinedAtom;
+using lld::pecoff::COFFDefinedFileAtom;
+using lld::pecoff::COFFReference;
+using lld::pecoff::COFFUndefinedAtom;
using llvm::object::coff_aux_section_definition;
using llvm::object::coff_aux_weak_external;
using llvm::object::coff_relocation;
@@ -829,7 +829,7 @@ ReaderCOFF::parseFile(std::unique_ptr<Me
if (fileType == llvm::sys::fs::file_magic::windows_resource)
return convertAndParseResourceFile(mb, result);
if (fileType == llvm::sys::fs::file_magic::coff_import_library)
- return lld::coff::parseCOFFImportLibrary(_context, mb, result);
+ return lld::pecoff::parseCOFFImportLibrary(_context, mb, result);
return parseCOFFFile(mb, result);
}
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp Thu Dec 12 20:58:27 2013
@@ -146,7 +146,7 @@ using namespace lld;
using namespace llvm;
namespace lld {
-namespace coff {
+namespace pecoff {
namespace {
@@ -316,5 +316,5 @@ error_code parseCOFFImportLibrary(const
return error_code::success();
}
-} // end namespace coff
+} // end namespace pecoff
} // end namespace lld
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.h?rev=197201&r1=197200&r2=197201&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.h Thu Dec 12 20:58:27 2013
@@ -22,7 +22,7 @@ namespace lld {
class LinkingContext;
class File;
-namespace coff {
+namespace pecoff {
error_code parseCOFFImportLibrary(const LinkingContext &context,
std::unique_ptr<MemoryBuffer> &mb,
More information about the llvm-commits
mailing list