|
1 | | -//====- LowerAttrToLLVMIR.cpp - Lowering CIR attributes to LLVMIR ---------===// |
| 1 | +//====- LoweToLLVMIR.cpp - Lowering CIR attributes to LLVMIR ---------===// |
2 | 2 | // |
3 | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | 4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | 6 | // |
7 | 7 | //===----------------------------------------------------------------------===// |
8 | 8 | // |
9 | | -// This file implements lowering of CIR attributes to LLVMIR. |
| 9 | +// This file implements lowering of CIR attributes and operations directly to |
| 10 | +// LLVMIR. |
10 | 11 | // |
11 | 12 | //===----------------------------------------------------------------------===// |
12 | 13 |
|
@@ -58,7 +59,8 @@ class CIRDialectLLVMIRTranslationInterface |
58 | 59 | if (auto extraAttr = attribute.getValue() |
59 | 60 | .dyn_cast<mlir::cir::ExtraFuncAttributesAttr>()) { |
60 | 61 | for (auto attr : extraAttr.getElements()) { |
61 | | - if (auto inlineAttr = attr.getValue().dyn_cast<mlir::cir::InlineAttr>()) { |
| 62 | + if (auto inlineAttr = |
| 63 | + attr.getValue().dyn_cast<mlir::cir::InlineAttr>()) { |
62 | 64 | if (inlineAttr.isNoInline()) |
63 | 65 | llvmFunc->addFnAttr(llvm::Attribute::NoInline); |
64 | 66 | else if (inlineAttr.isAlwaysInline()) |
@@ -95,9 +97,10 @@ class CIRDialectLLVMIRTranslationInterface |
95 | 97 |
|
96 | 98 | void registerCIRDialectTranslation(mlir::DialectRegistry ®istry) { |
97 | 99 | registry.insert<mlir::cir::CIRDialect>(); |
98 | | - registry.addExtension(+[](mlir::MLIRContext *ctx, mlir::cir::CIRDialect *dialect) { |
99 | | - dialect->addInterfaces<CIRDialectLLVMIRTranslationInterface>(); |
100 | | - }); |
| 100 | + registry.addExtension( |
| 101 | + +[](mlir::MLIRContext *ctx, mlir::cir::CIRDialect *dialect) { |
| 102 | + dialect->addInterfaces<CIRDialectLLVMIRTranslationInterface>(); |
| 103 | + }); |
101 | 104 | } |
102 | 105 |
|
103 | 106 | void registerCIRDialectTranslation(mlir::MLIRContext &context) { |
|
0 commit comments