diff options
author | Ilia Diachkov <iliya.diyachkov@intel.com> | 2022-04-14 01:10:08 +0300 |
---|---|---|
committer | Michal Paszkowski <michal.paszkowski@outlook.com> | 2022-04-20 01:10:25 +0200 |
commit | 6c69427e880bf7bbcb711d24c65961f062256f2d (patch) | |
tree | 3a38ae2797a69b3e7806ca607261503a83463632 /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | 40114dd5bf41f0d504a45ee5f7de9663d85251b8 (diff) | |
download | llvm-6c69427e880bf7bbcb711d24c65961f062256f2d.zip llvm-6c69427e880bf7bbcb711d24c65961f062256f2d.tar.gz llvm-6c69427e880bf7bbcb711d24c65961f062256f2d.tar.bz2 |
[SPIR-V](3/6) Add MC layer, object file support, and InstPrinter
The patch adds SPIRV-specific MC layer implementation, SPIRV object
file support and SPIRVInstPrinter.
Differential Revision: https://reviews.llvm.org/D116462
Authors: Aleksandr Bezzubikov, Lewis Crawford, Ilia Diachkov,
Michal Paszkowski, Andrey Tretyakov, Konrad Trifunovic
Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Co-authored-by: Ilia Diachkov <iliya.diyachkov@intel.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com>
Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 3da477d..5bd3fcc 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -19,6 +19,7 @@ #include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionGOFF.h" #include "llvm/MC/MCSectionMachO.h" +#include "llvm/MC/MCSectionSPIRV.h" #include "llvm/MC/MCSectionWasm.h" #include "llvm/MC/MCSectionXCOFF.h" #include "llvm/Support/Casting.h" @@ -804,6 +805,11 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) { SectionKind::getReadOnly()); } +void MCObjectFileInfo::initSPIRVMCObjectFileInfo(const Triple &T) { + // Put everything in a single binary section. + TextSection = Ctx->getSPIRVSection(); +} + void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) { TextSection = Ctx->getWasmSection(".text", SectionKind::getText()); DataSection = Ctx->getWasmSection(".data", SectionKind::getData()); @@ -1032,6 +1038,9 @@ void MCObjectFileInfo::initMCObjectFileInfo(MCContext &MCCtx, bool PIC, case MCContext::IsGOFF: initGOFFMCObjectFileInfo(TheTriple); break; + case MCContext::IsSPIRV: + initSPIRVMCObjectFileInfo(TheTriple); + break; case MCContext::IsWasm: initWasmMCObjectFileInfo(TheTriple); break; @@ -1055,6 +1064,7 @@ MCSection *MCObjectFileInfo::getDwarfComdatSection(const char *Name, case Triple::MachO: case Triple::COFF: case Triple::GOFF: + case Triple::SPIRV: case Triple::XCOFF: case Triple::DXContainer: case Triple::UnknownObjectFormat: |