mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-10 04:44:53 +00:00
Consistent use of header file for ICF and MarkLive
Previously wasm used a separate header to declare markLive and ELF used to declare ICF. This change makes each backend consistently declare these in their own headers. Differential Revision: https://reviews.llvm.org/D43529 llvm-svn: 325631
This commit is contained in:
parent
fd0630665b
commit
f187c4d2e5
@ -9,7 +9,9 @@
|
||||
|
||||
#include "Driver.h"
|
||||
#include "Config.h"
|
||||
#include "ICF.h"
|
||||
#include "InputFiles.h"
|
||||
#include "MarkLive.h"
|
||||
#include "MinGW.h"
|
||||
#include "SymbolTable.h"
|
||||
#include "Symbols.h"
|
||||
@ -37,8 +39,8 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/ToolDrivers/llvm-lib/LibDriver.h"
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <future>
|
||||
#include <memory>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::object;
|
||||
|
@ -36,12 +36,6 @@ using llvm::COFF::MachineTypes;
|
||||
using llvm::COFF::WindowsSubsystem;
|
||||
using llvm::Optional;
|
||||
|
||||
// Implemented in MarkLive.cpp.
|
||||
void markLive(ArrayRef<Chunk *> Chunks);
|
||||
|
||||
// Implemented in ICF.cpp.
|
||||
void doICF(ArrayRef<Chunk *> Chunks);
|
||||
|
||||
class COFFOptTable : public llvm::opt::OptTable {
|
||||
public:
|
||||
COFFOptTable();
|
||||
|
@ -18,6 +18,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "ICF.h"
|
||||
#include "Chunks.h"
|
||||
#include "Symbols.h"
|
||||
#include "lld/Common/ErrorHandler.h"
|
||||
|
26
lld/COFF/ICF.h
Normal file
26
lld/COFF/ICF.h
Normal file
@ -0,0 +1,26 @@
|
||||
//===- ICF.h --------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Linker
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLD_COFF_ICF_H
|
||||
#define LLD_COFF_ICF_H
|
||||
|
||||
#include "lld/Common/LLVM.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
|
||||
class Chunk;
|
||||
|
||||
void doICF(ArrayRef<Chunk *> Chunks);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
|
||||
#endif
|
24
lld/COFF/MarkLive.h
Normal file
24
lld/COFF/MarkLive.h
Normal file
@ -0,0 +1,24 @@
|
||||
//===- MarkLive.h -----------------------------------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Linker
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLD_COFF_MARKLIVE_H
|
||||
#define LLD_COFF_MARKLIVE_H
|
||||
|
||||
#include "lld/Common/LLVM.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
|
||||
namespace lld {
|
||||
namespace coff {
|
||||
|
||||
void markLive(ArrayRef<Chunk *> Chunks);
|
||||
|
||||
} // namespace coff
|
||||
} // namespace lld
|
||||
|
||||
#endif // LLD_COFF_MARKLIVE_H
|
@ -30,6 +30,7 @@
|
||||
#include "InputFiles.h"
|
||||
#include "InputSection.h"
|
||||
#include "LinkerScript.h"
|
||||
#include "MarkLive.h"
|
||||
#include "OutputSections.h"
|
||||
#include "ScriptParser.h"
|
||||
#include "Strings.h"
|
||||
|
@ -12,8 +12,10 @@
|
||||
|
||||
namespace lld {
|
||||
namespace elf {
|
||||
|
||||
template <class ELFT> void doIcf();
|
||||
}
|
||||
|
||||
} // namespace elf
|
||||
} // namespace lld
|
||||
|
||||
#endif
|
||||
|
@ -20,6 +20,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MarkLive.h"
|
||||
#include "InputSection.h"
|
||||
#include "LinkerScript.h"
|
||||
#include "OutputSections.h"
|
||||
@ -27,7 +28,6 @@
|
||||
#include "SymbolTable.h"
|
||||
#include "Symbols.h"
|
||||
#include "Target.h"
|
||||
#include "Writer.h"
|
||||
#include "lld/Common/Memory.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/Object/ELF.h"
|
||||
|
21
lld/ELF/MarkLive.h
Normal file
21
lld/ELF/MarkLive.h
Normal file
@ -0,0 +1,21 @@
|
||||
//===- MarkLive.h -----------------------------------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Linker
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLD_ELF_MARKLIVE_H
|
||||
#define LLD_ELF_MARKLIVE_H
|
||||
|
||||
namespace lld {
|
||||
namespace elf {
|
||||
|
||||
template <class ELFT> void markLive();
|
||||
|
||||
} // namespace elf
|
||||
} // namespace lld
|
||||
|
||||
#endif // LLD_ELF_MARKLIVE_H
|
@ -10,8 +10,6 @@
|
||||
#include "Strings.h"
|
||||
#include "Config.h"
|
||||
#include "lld/Common/ErrorHandler.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Demangle/Demangle.h"
|
||||
#include <algorithm>
|
||||
|
@ -23,7 +23,6 @@ class InputSectionBase;
|
||||
template <class ELFT> class ObjFile;
|
||||
class SymbolTable;
|
||||
template <class ELFT> void writeResult();
|
||||
template <class ELFT> void markLive();
|
||||
|
||||
// This describes a program header entry.
|
||||
// Each contains type, access flags and range of output sections that will be
|
||||
|
Loading…
Reference in New Issue
Block a user