| 1 | //===---- SystemZ.cpp - SystemZ-specific CIR CodeGen ----------------------===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This provides SystemZ-specific CIR CodeGen logic. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include "ABIInfo.h" |
| 14 | #include "CIRGenModule.h" |
| 15 | #include "TargetInfo.h" |
| 16 | #include "clang/AST/Decl.h" |
| 17 | #include "clang/CIR/MissingFeatures.h" |
| 18 | |
| 19 | using namespace clang; |
| 20 | using namespace clang::CIRGen; |
| 21 | |
| 22 | namespace { |
| 23 | |
| 24 | class SystemZABIInfo : public ABIInfo { |
| 25 | public: |
| 26 | SystemZABIInfo(CIRGenTypes &cgt) : ABIInfo(cgt) {} |
| 27 | }; |
| 28 | |
| 29 | class SystemZTargetCIRGenInfo : public TargetCIRGenInfo { |
| 30 | public: |
| 31 | SystemZTargetCIRGenInfo(CIRGenTypes &cgt) |
| 32 | : TargetCIRGenInfo(std::make_unique<SystemZABIInfo>(args&: cgt)) {} |
| 33 | |
| 34 | void setTargetAttributes(const Decl *d, mlir::Operation *gv, |
| 35 | CIRGenModule &cgm) const override { |
| 36 | if (!d) |
| 37 | return; |
| 38 | assert(!cir::MissingFeatures::s390xVisibleVectorABI()); |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | } // namespace |
| 43 | |
| 44 | std::unique_ptr<TargetCIRGenInfo> |
| 45 | clang::CIRGen::createSystemZTargetCIRGenInfo(CIRGenTypes &cgt) { |
| 46 | return std::make_unique<SystemZTargetCIRGenInfo>(args&: cgt); |
| 47 | } |
| 48 |