Files
clang-p2996/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
Rui Ueyama 0ca149fce9 Rename TargetInfo -> LinkingContext.
Also change some local variable names: "ti" -> "context" and
"_targetInfo" -> "_context".

Differential Revision: http://llvm-reviews.chandlerc.com/D1301

llvm-svn: 187823
2013-08-06 22:31:59 +00:00

48 lines
1.3 KiB
C++

//===- 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_ATOM_H_
#define LLD_READER_WRITER_MACHO_EXECUTABLE_ATOM_H_
#include "lld/Core/DefinedAtom.h"
#include "lld/Core/UndefinedAtom.h"
#include "lld/Core/File.h"
#include "lld/Core/Reference.h"
#include "lld/Core/LinkingContext.h"
#include "lld/ReaderWriter/Simple.h"
namespace lld {
namespace mach_o {
//
// CRuntimeFile adds an UndefinedAtom for "_main" so that the Resolving
// phase will fail if "_main" is undefined.
//
class CRuntimeFile : public SimpleFile {
public:
CRuntimeFile(const MachOLinkingContext &context)
: SimpleFile(context, "C runtime"),
_undefMain(*this, context.entrySymbolName()) {
// only main executables need _main
if (context.outputFileType() == MH_EXECUTE) {
this->addAtom(_undefMain);
}
}
private:
SimpleUndefinedAtom _undefMain;
};
} // namespace mach_o
} // namespace lld
#endif // LLD_READER_WRITER_MACHO_EXECUTABLE_ATOM_H_