Skip to content

Commit 22259ff

Browse files
committed
[CIR][Lowering][NFC] Rename LowerAttrToLLVMIR to LowerToLLVMIR
The rationale is that we are lowering more than just attributes now, also to maintain the naming standard of the other lowering files (e.g. LowerToLLVM). ghstack-source-id: c4a3b0e Pull Request resolved: #220
1 parent 4013d3f commit 22259ff

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

clang/lib/CIR/Lowering/DirectToLLVM/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(LLVM_LINK_COMPONENTS
66
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
77

88
add_clang_library(clangCIRLoweringDirectToLLVM
9-
LowerAttrToLLVMIR.cpp
9+
LowerToLLVMIR.cpp
1010
LowerToLLVM.cpp
1111

1212
DEPENDS

clang/lib/CIR/Lowering/DirectToLLVM/LowerAttrToLLVMIR.cpp renamed to clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVMIR.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
//====- LowerAttrToLLVMIR.cpp - Lowering CIR attributes to LLVMIR ---------===//
1+
//====- LoweToLLVMIR.cpp - Lowering CIR attributes to LLVMIR ---------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file implements lowering of CIR attributes to LLVMIR.
9+
// This file implements lowering of CIR attributes and operations directly to
10+
// LLVMIR.
1011
//
1112
//===----------------------------------------------------------------------===//
1213

@@ -58,7 +59,8 @@ class CIRDialectLLVMIRTranslationInterface
5859
if (auto extraAttr = attribute.getValue()
5960
.dyn_cast<mlir::cir::ExtraFuncAttributesAttr>()) {
6061
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>()) {
6264
if (inlineAttr.isNoInline())
6365
llvmFunc->addFnAttr(llvm::Attribute::NoInline);
6466
else if (inlineAttr.isAlwaysInline())
@@ -95,9 +97,10 @@ class CIRDialectLLVMIRTranslationInterface
9597

9698
void registerCIRDialectTranslation(mlir::DialectRegistry &registry) {
9799
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+
});
101104
}
102105

103106
void registerCIRDialectTranslation(mlir::MLIRContext &context) {

0 commit comments

Comments
 (0)