mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2026-07-23 12:15:49 -04:00
eb66b33867
I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
110 lines
3.6 KiB
C++
110 lines
3.6 KiB
C++
//===-- llvm/CodeGen/MachineModuleInfoImpls.h -------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines object-file format specific implementations of
|
|
// MachineModuleInfoImpl.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
|
|
#define LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
|
|
|
|
#include "llvm/CodeGen/MachineModuleInfo.h"
|
|
#include "llvm/CodeGen/ValueTypes.h"
|
|
#include "llvm/Support/Wasm.h"
|
|
|
|
namespace llvm {
|
|
class MCSymbol;
|
|
|
|
/// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
|
|
/// for MachO targets.
|
|
class MachineModuleInfoMachO : public MachineModuleInfoImpl {
|
|
/// GVStubs - Darwin '$non_lazy_ptr' stubs. The key is something like
|
|
/// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
|
|
/// is true if this GV is external.
|
|
DenseMap<MCSymbol *, StubValueTy> GVStubs;
|
|
|
|
/// ThreadLocalGVStubs - Darwin '$non_lazy_ptr' stubs. The key is something
|
|
/// like "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra
|
|
/// bit is true if this GV is external.
|
|
DenseMap<MCSymbol *, StubValueTy> ThreadLocalGVStubs;
|
|
|
|
virtual void anchor(); // Out of line virtual method.
|
|
public:
|
|
MachineModuleInfoMachO(const MachineModuleInfo &) {}
|
|
|
|
StubValueTy &getGVStubEntry(MCSymbol *Sym) {
|
|
assert(Sym && "Key cannot be null");
|
|
return GVStubs[Sym];
|
|
}
|
|
|
|
StubValueTy &getThreadLocalGVStubEntry(MCSymbol *Sym) {
|
|
assert(Sym && "Key cannot be null");
|
|
return ThreadLocalGVStubs[Sym];
|
|
}
|
|
|
|
/// Accessor methods to return the set of stubs in sorted order.
|
|
SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
|
|
SymbolListTy GetThreadLocalGVStubList() {
|
|
return getSortedStubs(ThreadLocalGVStubs);
|
|
}
|
|
};
|
|
|
|
/// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
|
|
/// for ELF targets.
|
|
class MachineModuleInfoELF : public MachineModuleInfoImpl {
|
|
/// GVStubs - These stubs are used to materialize global addresses in PIC
|
|
/// mode.
|
|
DenseMap<MCSymbol *, StubValueTy> GVStubs;
|
|
|
|
virtual void anchor(); // Out of line virtual method.
|
|
public:
|
|
MachineModuleInfoELF(const MachineModuleInfo &) {}
|
|
|
|
StubValueTy &getGVStubEntry(MCSymbol *Sym) {
|
|
assert(Sym && "Key cannot be null");
|
|
return GVStubs[Sym];
|
|
}
|
|
|
|
/// Accessor methods to return the set of stubs in sorted order.
|
|
|
|
SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
|
|
};
|
|
|
|
/// MachineModuleInfoWasm - This is a MachineModuleInfoImpl implementation
|
|
/// for Wasm targets.
|
|
class MachineModuleInfoWasm : public MachineModuleInfoImpl {
|
|
/// WebAssembly global variables defined by CodeGen.
|
|
std::vector<wasm::Global> Globals;
|
|
|
|
/// The WebAssembly global variable which is the stack pointer.
|
|
unsigned StackPointerGlobal;
|
|
|
|
virtual void anchor(); // Out of line virtual method.
|
|
public:
|
|
MachineModuleInfoWasm(const MachineModuleInfo &)
|
|
: StackPointerGlobal(-1U) {}
|
|
|
|
void addGlobal(const wasm::Global &G) { Globals.push_back(G); }
|
|
const std::vector<wasm::Global> &getGlobals() const { return Globals; }
|
|
|
|
bool hasStackPointerGlobal() const {
|
|
return StackPointerGlobal != -1U;
|
|
}
|
|
unsigned getStackPointerGlobal() const {
|
|
assert(hasStackPointerGlobal() && "Stack ptr global hasn't been set");
|
|
return StackPointerGlobal;
|
|
}
|
|
void setStackPointerGlobal(unsigned Global) { StackPointerGlobal = Global; }
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif
|