[lld] r234943 - Rename ExecutableAtom.hpp to ExecutableAtom.h
Davide Italiano
davide at freebsd.org
Tue Apr 14 14:06:56 PDT 2015
Author: davide
Date: Tue Apr 14 16:06:56 2015
New Revision: 234943
URL: http://llvm.org/viewvc/llvm-project?rev=234943&view=rev
Log:
Rename ExecutableAtom.hpp to ExecutableAtom.h
This is for consistency with what's used elsewhere in lld tree.
Added:
lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.h
- copied, changed from r234934, lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
Removed:
lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
Modified:
lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp
Copied: lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.h (from r234934, lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.h?p2=lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.h&p1=lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp&r1=234934&r2=234943&rev=234943&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.h Tue Apr 14 16:06:56 2015
@@ -1,4 +1,4 @@
-//===- lib/ReaderWriter/MachO/ExecutableAtoms.hpp -------------------------===//
+//===- lib/ReaderWriter/MachO/ExecutableAtoms.h ---------------------------===//
//
// The LLVM Linker
//
Removed: lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp?rev=234942&view=auto
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ExecutableAtoms.hpp (removed)
@@ -1,133 +0,0 @@
-//===- lib/ReaderWriter/MachO/ExecutableAtoms.hpp -------------------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_READER_WRITER_MACHO_EXECUTABLE_ATOMS_H
-#define LLD_READER_WRITER_MACHO_EXECUTABLE_ATOMS_H
-
-#include "Atoms.h"
-
-#include "llvm/Support/MachO.h"
-
-#include "lld/Core/ArchiveLibraryFile.h"
-#include "lld/Core/DefinedAtom.h"
-#include "lld/Core/File.h"
-#include "lld/Core/LinkingContext.h"
-#include "lld/Core/Reference.h"
-#include "lld/Core/Simple.h"
-#include "lld/Core/UndefinedAtom.h"
-#include "lld/ReaderWriter/MachOLinkingContext.h"
-
-namespace lld {
-namespace mach_o {
-
-
-//
-// CEntryFile adds an UndefinedAtom for "_main" so that the Resolving
-// phase will fail if "_main" is undefined.
-//
-class CEntryFile : public SimpleFile {
-public:
- CEntryFile(const MachOLinkingContext &context)
- : SimpleFile("C entry"),
- _undefMain(*this, context.entrySymbolName()) {
- this->addAtom(_undefMain);
- }
-
-private:
- SimpleUndefinedAtom _undefMain;
-};
-
-
-//
-// StubHelperFile adds an UndefinedAtom for "dyld_stub_binder" so that
-// the Resolveing phase will fail if "dyld_stub_binder" is undefined.
-//
-class StubHelperFile : public SimpleFile {
-public:
- StubHelperFile(const MachOLinkingContext &context)
- : SimpleFile("stub runtime"),
- _undefBinder(*this, context.binderSymbolName()) {
- this->addAtom(_undefBinder);
- }
-
-private:
- SimpleUndefinedAtom _undefBinder;
-};
-
-
-//
-// MachHeaderAliasFile lazily instantiates the magic symbols that mark the start
-// of the mach_header for final linked images.
-//
-class MachHeaderAliasFile : public ArchiveLibraryFile {
-public:
- MachHeaderAliasFile(const MachOLinkingContext &context)
- : ArchiveLibraryFile("mach_header symbols") {
- switch (context.outputMachOType()) {
- case llvm::MachO::MH_EXECUTE:
- _machHeaderSymbolName = "__mh_execute_header";
- break;
- case llvm::MachO::MH_DYLIB:
- _machHeaderSymbolName = "__mh_dylib_header";
- break;
- case llvm::MachO::MH_BUNDLE:
- _machHeaderSymbolName = "__mh_bundle_header";
- break;
- case llvm::MachO::MH_DYLINKER:
- _machHeaderSymbolName = "__mh_dylinker_header";
- break;
- case llvm::MachO::MH_PRELOAD:
- _machHeaderSymbolName = "__mh_preload_header";
- break;
- default:
- llvm_unreachable("no mach_header symbol for file type");
- }
- }
-
- std::error_code
- parseAllMembers(std::vector<std::unique_ptr<File>> &result) override {
- return std::error_code();
- }
-
- File *find(StringRef sym, bool dataSymbolOnly) override {
- if (sym.equals("___dso_handle") || sym.equals(_machHeaderSymbolName)) {
- _definedAtoms.push_back(new (allocator()) MachODefinedAtom(
- *this, sym, DefinedAtom::scopeLinkageUnit,
- DefinedAtom::typeMachHeader, DefinedAtom::mergeNo, false, false,
- ArrayRef<uint8_t>(), DefinedAtom::Alignment(4096)));
- return this;
- }
- return nullptr;
- }
-
- const AtomVector<DefinedAtom> &defined() const override {
- return _definedAtoms;
- }
- const AtomVector<UndefinedAtom> &undefined() const override {
- return _noUndefinedAtoms;
- }
-
- const AtomVector<SharedLibraryAtom> &sharedLibrary() const override {
- return _noSharedLibraryAtoms;
- }
-
- const AtomVector<AbsoluteAtom> &absolute() const override {
- return _noAbsoluteAtoms;
- }
-
-
-private:
- mutable AtomVector<DefinedAtom> _definedAtoms;
- StringRef _machHeaderSymbolName;
-};
-
-} // namespace mach_o
-} // namespace lld
-
-#endif // LLD_READER_WRITER_MACHO_EXECUTABLE_ATOMS_H
Modified: lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp?rev=234943&r1=234942&r2=234943&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp Tue Apr 14 16:06:56 2015
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-#include "ExecutableAtoms.hpp"
+#include "ExecutableAtoms.h"
#include "MachONormalizedFile.h"
#include "lld/Core/File.h"
#include "lld/Core/Writer.h"
More information about the llvm-commits
mailing list