diff options
author | Andy Kaylor <akaylor@nvidia.com> | 2025-02-19 09:08:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-19 09:08:37 -0800 |
commit | 75ea7aed93ec8afa43634a41c2e94380ba0d671e (patch) | |
tree | 6cbda8cde083a6441b515a668117c066d228cb73 /clang/lib/CIR/CodeGen/CIRGenModule.cpp | |
parent | ddf24086f119cacf2a0fc489773f8af302f4a489 (diff) | |
download | llvm-75ea7aed93ec8afa43634a41c2e94380ba0d671e.zip llvm-75ea7aed93ec8afa43634a41c2e94380ba0d671e.tar.gz llvm-75ea7aed93ec8afa43634a41c2e94380ba0d671e.tar.bz2 |
[CIR] Add additional frontend actions (#127249)
Add frontend actions to support emitting assembly, bitcode, and object
files when compiling with ClangIR. This change also correctly sets and
propagates the target triple in the MLIR and LLVM modules, which was a
necessary prerequisite for emitting assembly and object files.
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r-- | clang/lib/CIR/CodeGen/CIRGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index 2615ae3..cbecdf9 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -52,6 +52,9 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, DoubleTy = cir::DoubleType::get(&getMLIRContext()); FP80Ty = cir::FP80Type::get(&getMLIRContext()); FP128Ty = cir::FP128Type::get(&getMLIRContext()); + + theModule->setAttr(cir::CIRDialect::getTripleAttrName(), + builder.getStringAttr(getTriple().str())); } mlir::Location CIRGenModule::getLoc(SourceLocation cLoc) { |