mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-01 01:31:26 +00:00
Replace typedef A B
with using B = A
. NFC.
I did this using Perl. Differential Revision: https://reviews.llvm.org/D60003 llvm-svn: 357372
This commit is contained in:
parent
7fb58e98f5
commit
68b9f45fee
@ -96,7 +96,7 @@ static std::string getOutputPath(StringRef Path) {
|
||||
// FIXME: We could open the file in createFutureForFile and avoid needing to
|
||||
// return an error here, but for the moment that would cost us a file descriptor
|
||||
// (a limited resource on Windows) for the duration that the future is pending.
|
||||
typedef std::pair<std::unique_ptr<MemoryBuffer>, std::error_code> MBErrPair;
|
||||
using MBErrPair = std::pair<std::unique_ptr<MemoryBuffer>, std::error_code>;
|
||||
|
||||
// Create a std::future that opens and maps a file using the best strategy for
|
||||
// the host platform.
|
||||
|
@ -32,8 +32,8 @@ using namespace llvm::object;
|
||||
using namespace lld;
|
||||
using namespace lld::coff;
|
||||
|
||||
typedef DenseMap<const SectionChunk *, SmallVector<DefinedRegular *, 4>>
|
||||
SymbolMapTy;
|
||||
using SymbolMapTy =
|
||||
DenseMap<const SectionChunk *, SmallVector<DefinedRegular *, 4>>;
|
||||
|
||||
static const std::string Indent8 = " "; // 8 spaces
|
||||
static const std::string Indent16 = " "; // 16 spaces
|
||||
|
@ -92,8 +92,8 @@ constexpr int MAX_DENSITY_DEGRADATION = 8;
|
||||
constexpr uint64_t MAX_CLUSTER_SIZE = 1024 * 1024;
|
||||
} // end anonymous namespace
|
||||
|
||||
typedef std::pair<const InputSectionBase *, const InputSectionBase *>
|
||||
SectionPair;
|
||||
using SectionPair =
|
||||
std::pair<const InputSectionBase *, const InputSectionBase *>;
|
||||
|
||||
// Take the edge list in Config->CallGraphProfile, resolve symbol names to
|
||||
// Symbols, and generate a graph between InputSections with the provided
|
||||
|
@ -147,10 +147,10 @@ private:
|
||||
|
||||
template <typename ELFT> class ELFFileBase : public InputFile {
|
||||
public:
|
||||
typedef typename ELFT::Shdr Elf_Shdr;
|
||||
typedef typename ELFT::Sym Elf_Sym;
|
||||
typedef typename ELFT::Word Elf_Word;
|
||||
typedef typename ELFT::SymRange Elf_Sym_Range;
|
||||
using Elf_Shdr = typename ELFT::Shdr;
|
||||
using Elf_Sym = typename ELFT::Sym;
|
||||
using Elf_Word = typename ELFT::Word;
|
||||
using Elf_Sym_Range = typename ELFT::SymRange;
|
||||
|
||||
ELFFileBase(Kind K, MemoryBufferRef M);
|
||||
static bool classof(const InputFile *F) { return F->isElf(); }
|
||||
@ -176,13 +176,13 @@ protected:
|
||||
|
||||
// .o file.
|
||||
template <class ELFT> class ObjFile : public ELFFileBase<ELFT> {
|
||||
typedef ELFFileBase<ELFT> Base;
|
||||
typedef typename ELFT::Rel Elf_Rel;
|
||||
typedef typename ELFT::Rela Elf_Rela;
|
||||
typedef typename ELFT::Sym Elf_Sym;
|
||||
typedef typename ELFT::Shdr Elf_Shdr;
|
||||
typedef typename ELFT::Word Elf_Word;
|
||||
typedef typename ELFT::CGProfile Elf_CGProfile;
|
||||
using Base = ELFFileBase<ELFT>;
|
||||
using Elf_Rel = typename ELFT::Rel;
|
||||
using Elf_Rela = typename ELFT::Rela;
|
||||
using Elf_Sym = typename ELFT::Sym;
|
||||
using Elf_Shdr = typename ELFT::Shdr;
|
||||
using Elf_Word = typename ELFT::Word;
|
||||
using Elf_CGProfile = typename ELFT::CGProfile;
|
||||
|
||||
StringRef getShtGroupSignature(ArrayRef<Elf_Shdr> Sections,
|
||||
const Elf_Shdr &Sec);
|
||||
@ -321,13 +321,13 @@ public:
|
||||
|
||||
// .so file.
|
||||
template <class ELFT> class SharedFile : public ELFFileBase<ELFT> {
|
||||
typedef ELFFileBase<ELFT> Base;
|
||||
typedef typename ELFT::Dyn Elf_Dyn;
|
||||
typedef typename ELFT::Shdr Elf_Shdr;
|
||||
typedef typename ELFT::Sym Elf_Sym;
|
||||
typedef typename ELFT::SymRange Elf_Sym_Range;
|
||||
typedef typename ELFT::Verdef Elf_Verdef;
|
||||
typedef typename ELFT::Versym Elf_Versym;
|
||||
using Base = ELFFileBase<ELFT>;
|
||||
using Elf_Dyn = typename ELFT::Dyn;
|
||||
using Elf_Shdr = typename ELFT::Shdr;
|
||||
using Elf_Sym = typename ELFT::Sym;
|
||||
using Elf_Sym_Range = typename ELFT::SymRange;
|
||||
using Elf_Verdef = typename ELFT::Verdef;
|
||||
using Elf_Versym = typename ELFT::Versym;
|
||||
|
||||
const Elf_Shdr *VersymSec = nullptr;
|
||||
const Elf_Shdr *VerdefSec = nullptr;
|
||||
|
@ -210,8 +210,8 @@ OutputSection *SectionBase::getOutputSection() {
|
||||
// by zlib-compressed data. This function parses a header to initialize
|
||||
// `UncompressedSize` member and remove the header from `RawData`.
|
||||
void InputSectionBase::parseCompressedHeader() {
|
||||
typedef typename ELF64LE::Chdr Chdr64;
|
||||
typedef typename ELF32LE::Chdr Chdr32;
|
||||
using Chdr64 = typename ELF64LE::Chdr;
|
||||
using Chdr32 = typename ELF32LE::Chdr;
|
||||
|
||||
// Old-style header
|
||||
if (Name.startswith(".zdebug")) {
|
||||
@ -380,7 +380,7 @@ OutputSection *InputSection::getParent() const {
|
||||
// Copy SHT_GROUP section contents. Used only for the -r option.
|
||||
template <class ELFT> void InputSection::copyShtGroup(uint8_t *Buf) {
|
||||
// ELFT::Word is the 32-bit integral type in the target endianness.
|
||||
typedef typename ELFT::Word u32;
|
||||
using u32 = typename ELFT::Word;
|
||||
ArrayRef<u32> From = getDataAs<u32>();
|
||||
auto *To = reinterpret_cast<u32 *>(Buf);
|
||||
|
||||
|
@ -67,7 +67,7 @@ struct ExprValue {
|
||||
// This represents an expression in the linker script.
|
||||
// ScriptParser::readExpr reads an expression and returns an Expr.
|
||||
// Later, we evaluate the expression by calling the function.
|
||||
typedef std::function<ExprValue()> Expr;
|
||||
using Expr = std::function<ExprValue()>;
|
||||
|
||||
// This enum is used to implement linker script SECTIONS command.
|
||||
// https://sourceware.org/binutils/docs/ld/SECTIONS.html#SECTIONS
|
||||
|
@ -37,7 +37,7 @@ using namespace llvm::object;
|
||||
using namespace lld;
|
||||
using namespace lld::elf;
|
||||
|
||||
typedef DenseMap<const SectionBase *, SmallVector<Defined *, 4>> SymbolMapTy;
|
||||
using SymbolMapTy = DenseMap<const SectionBase *, SmallVector<Defined *, 4>>;
|
||||
|
||||
static const std::string Indent8 = " "; // 8 spaces
|
||||
static const std::string Indent16 = " "; // 16 spaces
|
||||
|
@ -138,7 +138,7 @@ void OutputSection::addSection(InputSection *IS) {
|
||||
|
||||
static void sortByOrder(MutableArrayRef<InputSection *> In,
|
||||
llvm::function_ref<int(InputSectionBase *S)> Order) {
|
||||
typedef std::pair<int, InputSection *> Pair;
|
||||
using Pair = std::pair<int, InputSection *>;
|
||||
auto Comp = [](const Pair &A, const Pair &B) { return A.first < B.first; };
|
||||
|
||||
std::vector<Pair> V;
|
||||
@ -179,7 +179,7 @@ static void fill(uint8_t *Buf, size_t Size,
|
||||
|
||||
// Compress section contents if this section contains debug info.
|
||||
template <class ELFT> void OutputSection::maybeCompress() {
|
||||
typedef typename ELFT::Chdr Elf_Chdr;
|
||||
using Elf_Chdr = typename ELFT::Chdr;
|
||||
|
||||
// Compress only DWARF debug sections.
|
||||
if (!Config->CompressDebugSections || (Flags & SHF_ALLOC) ||
|
||||
|
@ -479,7 +479,7 @@ static RelExpr fromPlt(RelExpr Expr) {
|
||||
|
||||
// Returns true if a given shared symbol is in a read-only segment in a DSO.
|
||||
template <class ELFT> static bool isReadOnly(SharedSymbol &SS) {
|
||||
typedef typename ELFT::Phdr Elf_Phdr;
|
||||
using Elf_Phdr = typename ELFT::Phdr;
|
||||
|
||||
// Determine if the symbol is read-only by scanning the DSO's program headers.
|
||||
const SharedFile<ELFT> &File = SS.getFile<ELFT>();
|
||||
@ -498,7 +498,7 @@ template <class ELFT> static bool isReadOnly(SharedSymbol &SS) {
|
||||
// Otherwise, they would refer to different places at runtime.
|
||||
template <class ELFT>
|
||||
static SmallSet<SharedSymbol *, 4> getSymbolsAt(SharedSymbol &SS) {
|
||||
typedef typename ELFT::Sym Elf_Sym;
|
||||
using Elf_Sym = typename ELFT::Sym;
|
||||
|
||||
SharedFile<ELFT> &File = SS.getFile<ELFT>();
|
||||
|
||||
|
@ -23,7 +23,7 @@ class OutputSection;
|
||||
class SectionBase;
|
||||
|
||||
// Represents a relocation type, such as R_X86_64_PC32 or R_ARM_THM_CALL.
|
||||
typedef uint32_t RelType;
|
||||
using RelType = uint32_t;
|
||||
|
||||
// List of target-independent relocation types. Relocations read
|
||||
// from files are converted to these types so that the main code
|
||||
|
@ -2474,8 +2474,8 @@ readPubNamesAndTypes(const LLDDwarfObj<ELFT> &Obj,
|
||||
static std::vector<GdbIndexSection::GdbSymbol>
|
||||
createSymbols(ArrayRef<std::vector<GdbIndexSection::NameAttrEntry>> NameAttrs,
|
||||
const std::vector<GdbIndexSection::GdbChunk> &Chunks) {
|
||||
typedef GdbIndexSection::GdbSymbol GdbSymbol;
|
||||
typedef GdbIndexSection::NameAttrEntry NameAttrEntry;
|
||||
using GdbSymbol = GdbIndexSection::GdbSymbol;
|
||||
using NameAttrEntry = GdbIndexSection::NameAttrEntry;
|
||||
|
||||
// For each chunk, compute the number of compilation units preceding it.
|
||||
uint32_t CuIdx = 0;
|
||||
@ -2669,7 +2669,7 @@ void EhFrameHeader::writeTo(uint8_t *Buf) {
|
||||
// It is sorted by PC.
|
||||
void EhFrameHeader::write() {
|
||||
uint8_t *Buf = Out::BufferStart + getParent()->Offset + OutSecOff;
|
||||
typedef EhFrameSection::FdeData FdeData;
|
||||
using FdeData = EhFrameSection::FdeData;
|
||||
|
||||
std::vector<FdeData> Fdes = In.EhFrame->getFdeData();
|
||||
|
||||
|
@ -308,7 +308,7 @@ private:
|
||||
uint64_t Size = 0;
|
||||
|
||||
// Symbol and addend.
|
||||
typedef std::pair<Symbol *, int64_t> GotEntry;
|
||||
using GotEntry = std::pair<Symbol *, int64_t>;
|
||||
|
||||
struct FileGot {
|
||||
InputFile *File = nullptr;
|
||||
@ -443,12 +443,12 @@ private:
|
||||
};
|
||||
|
||||
template <class ELFT> class DynamicSection final : public SyntheticSection {
|
||||
typedef typename ELFT::Dyn Elf_Dyn;
|
||||
typedef typename ELFT::Rel Elf_Rel;
|
||||
typedef typename ELFT::Rela Elf_Rela;
|
||||
typedef typename ELFT::Relr Elf_Relr;
|
||||
typedef typename ELFT::Shdr Elf_Shdr;
|
||||
typedef typename ELFT::Sym Elf_Sym;
|
||||
using Elf_Dyn = typename ELFT::Dyn;
|
||||
using Elf_Rel = typename ELFT::Rel;
|
||||
using Elf_Rela = typename ELFT::Rela;
|
||||
using Elf_Relr = typename ELFT::Relr;
|
||||
using Elf_Shdr = typename ELFT::Shdr;
|
||||
using Elf_Sym = typename ELFT::Sym;
|
||||
|
||||
// finalizeContents() fills this vector with the section contents.
|
||||
std::vector<std::pair<int32_t, std::function<uint64_t()>>> Entries;
|
||||
@ -496,8 +496,8 @@ protected:
|
||||
|
||||
template <class ELFT>
|
||||
class RelocationSection final : public RelocationBaseSection {
|
||||
typedef typename ELFT::Rel Elf_Rel;
|
||||
typedef typename ELFT::Rela Elf_Rela;
|
||||
using Elf_Rel = typename ELFT::Rel;
|
||||
using Elf_Rela = typename ELFT::Rela;
|
||||
|
||||
public:
|
||||
RelocationSection(StringRef Name, bool Sort);
|
||||
@ -509,8 +509,8 @@ private:
|
||||
|
||||
template <class ELFT>
|
||||
class AndroidPackedRelocationSection final : public RelocationBaseSection {
|
||||
typedef typename ELFT::Rel Elf_Rel;
|
||||
typedef typename ELFT::Rela Elf_Rela;
|
||||
using Elf_Rel = typename ELFT::Rel;
|
||||
using Elf_Rela = typename ELFT::Rela;
|
||||
|
||||
public:
|
||||
AndroidPackedRelocationSection(StringRef Name);
|
||||
@ -544,7 +544,7 @@ public:
|
||||
// https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg
|
||||
// For more details, see the comment in RelrSection::updateAllocSize().
|
||||
template <class ELFT> class RelrSection final : public RelrBaseSection {
|
||||
typedef typename ELFT::Relr Elf_Relr;
|
||||
using Elf_Relr = typename ELFT::Relr;
|
||||
|
||||
public:
|
||||
RelrSection();
|
||||
@ -589,7 +589,7 @@ protected:
|
||||
|
||||
template <class ELFT>
|
||||
class SymbolTableSection final : public SymbolTableBaseSection {
|
||||
typedef typename ELFT::Sym Elf_Sym;
|
||||
using Elf_Sym = typename ELFT::Sym;
|
||||
|
||||
public:
|
||||
SymbolTableSection(StringTableSection &StrTabSec);
|
||||
@ -804,8 +804,8 @@ public:
|
||||
// mapping from version identifiers to version names.
|
||||
template <class ELFT>
|
||||
class VersionNeedSection final : public VersionNeedBaseSection {
|
||||
typedef typename ELFT::Verneed Elf_Verneed;
|
||||
typedef typename ELFT::Vernaux Elf_Vernaux;
|
||||
using Elf_Verneed = typename ELFT::Verneed;
|
||||
using Elf_Vernaux = typename ELFT::Vernaux;
|
||||
|
||||
// A vector of shared files that need Elf_Verneed data structures and the
|
||||
// string table offsets of their sonames.
|
||||
@ -880,7 +880,7 @@ private:
|
||||
// .MIPS.abiflags section.
|
||||
template <class ELFT>
|
||||
class MipsAbiFlagsSection final : public SyntheticSection {
|
||||
typedef llvm::object::Elf_Mips_ABIFlags<ELFT> Elf_Mips_ABIFlags;
|
||||
using Elf_Mips_ABIFlags = llvm::object::Elf_Mips_ABIFlags<ELFT>;
|
||||
|
||||
public:
|
||||
static MipsAbiFlagsSection *create();
|
||||
@ -895,8 +895,8 @@ private:
|
||||
|
||||
// .MIPS.options section.
|
||||
template <class ELFT> class MipsOptionsSection final : public SyntheticSection {
|
||||
typedef llvm::object::Elf_Mips_Options<ELFT> Elf_Mips_Options;
|
||||
typedef llvm::object::Elf_Mips_RegInfo<ELFT> Elf_Mips_RegInfo;
|
||||
using Elf_Mips_Options = llvm::object::Elf_Mips_Options<ELFT>;
|
||||
using Elf_Mips_RegInfo = llvm::object::Elf_Mips_RegInfo<ELFT>;
|
||||
|
||||
public:
|
||||
static MipsOptionsSection *create();
|
||||
@ -914,7 +914,7 @@ private:
|
||||
|
||||
// MIPS .reginfo section.
|
||||
template <class ELFT> class MipsReginfoSection final : public SyntheticSection {
|
||||
typedef llvm::object::Elf_Mips_RegInfo<ELFT> Elf_Mips_RegInfo;
|
||||
using Elf_Mips_RegInfo = llvm::object::Elf_Mips_RegInfo<ELFT>;
|
||||
|
||||
public:
|
||||
static MipsReginfoSection *create();
|
||||
|
@ -40,9 +40,9 @@ namespace {
|
||||
template <class ELFT> class Writer {
|
||||
public:
|
||||
Writer() : Buffer(errorHandler().OutputBuffer) {}
|
||||
typedef typename ELFT::Shdr Elf_Shdr;
|
||||
typedef typename ELFT::Ehdr Elf_Ehdr;
|
||||
typedef typename ELFT::Phdr Elf_Phdr;
|
||||
using Elf_Shdr = typename ELFT::Shdr;
|
||||
using Elf_Ehdr = typename ELFT::Ehdr;
|
||||
using Elf_Phdr = typename ELFT::Phdr;
|
||||
|
||||
void run();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user