diff options
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r-- | clang/lib/CIR/CodeGen/CIRGenModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index 7198b23..c1434ee 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -104,6 +104,12 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, theModule->setAttr(cir::CIRDialect::getTripleAttrName(), builder.getStringAttr(getTriple().str())); + + if (cgo.OptimizationLevel > 0 || cgo.OptimizeSize > 0) + theModule->setAttr(cir::CIRDialect::getOptInfoAttrName(), + cir::OptInfoAttr::get(&mlirContext, + cgo.OptimizationLevel, + cgo.OptimizeSize)); } CIRGenModule::~CIRGenModule() = default; |