@@ -4448,7 +4448,7 @@ std::unique_ptr<cir::LowerModule> prepareLowerModule(mlir::ModuleOp module) {
44484448 // If the triple is not present, e.g. CIR modules parsed from text, we
44494449 // cannot init LowerModule properly.
44504450 assert (!cir::MissingFeatures::makeTripleAlwaysPresent ());
4451- if (!module ->hasAttr (" cir.triple " ))
4451+ if (!module ->hasAttr (cir::CIRDialect::getTripleAttrName () ))
44524452 return {};
44534453 return cir::createLowerModule (module , rewriter);
44544454}
@@ -4706,7 +4706,8 @@ void ConvertCIRToLLVMPass::buildGlobalAnnotationsVar(
47064706 llvm::StringMap<mlir::LLVM::GlobalOp> &argStringGlobalsMap,
47074707 llvm::MapVector<mlir::ArrayAttr, mlir::LLVM::GlobalOp> &argsVarMap) {
47084708 mlir::ModuleOp module = getOperation ();
4709- mlir::Attribute attr = module ->getAttr (" cir.global_annotations" );
4709+ mlir::Attribute attr =
4710+ module ->getAttr (cir::CIRDialect::getGlobalAnnotationsAttrName ());
47104711 if (!attr)
47114712 return ;
47124713 if (auto globalAnnotValues =
@@ -4834,8 +4835,8 @@ void ConvertCIRToLLVMPass::runOnOperation() {
48344835 // Allow operations that will be lowered directly to LLVM IR.
48354836 target.addLegalOp <mlir::LLVM::ZeroOp>();
48364837
4837- getOperation ()->removeAttr (" cir.sob " );
4838- getOperation ()->removeAttr (" cir.lang " );
4838+ getOperation ()->removeAttr (cir::CIRDialect::getSOBAttrName () );
4839+ getOperation ()->removeAttr (cir::CIRDialect::getLangAttrName () );
48394840
48404841 llvm::SmallVector<mlir::Operation *> ops;
48414842 ops.push_back (module );
@@ -4845,17 +4846,17 @@ void ConvertCIRToLLVMPass::runOnOperation() {
48454846 signalPassFailure ();
48464847
48474848 // Emit the llvm.global_ctors array.
4848- buildCtorDtorList (module , " cir.global_ctors " , " llvm.global_ctors " ,
4849- [](mlir::Attribute attr) {
4849+ buildCtorDtorList (module , cir::CIRDialect::getGlobalCtorsAttrName () ,
4850+ " llvm.global_ctors " , [](mlir::Attribute attr) {
48504851 assert (mlir::isa<cir::GlobalCtorAttr>(attr) &&
48514852 " must be a GlobalCtorAttr" );
48524853 auto ctorAttr = mlir::cast<cir::GlobalCtorAttr>(attr);
48534854 return std::make_pair (ctorAttr.getName (),
48544855 ctorAttr.getPriority ());
48554856 });
48564857 // Emit the llvm.global_dtors array.
4857- buildCtorDtorList (module , " cir.global_dtors " , " llvm.global_dtors " ,
4858- [](mlir::Attribute attr) {
4858+ buildCtorDtorList (module , cir::CIRDialect::getGlobalDtorsAttrName () ,
4859+ " llvm.global_dtors " , [](mlir::Attribute attr) {
48594860 assert (mlir::isa<cir::GlobalDtorAttr>(attr) &&
48604861 " must be a GlobalDtorAttr" );
48614862 auto dtorAttr = mlir::cast<cir::GlobalDtorAttr>(attr);
0 commit comments