[clang] [CIR] Source LoweringPrepare target facts from the module (PR #219078)

Konstantinos Parasyris via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 08:03:19 PDT 2026


================
@@ -298,6 +299,14 @@ struct LoweringPreparePass
 
   clang::ASTContext *astCtx;
 
+  /// Target/ABI facts sourced from the module's own attributes.
+  std::unique_ptr<cir::LowerModule> lowerModule;
+
+  const clang::TargetInfo &getTargetInfo() const {
+    assert(lowerModule && "LoweringPrepare requires a module with a triple");
----------------
koparasy wrote:

Not reachable: the CIRGen pipeline is the only caller and always sets the triple, plus the pass needs an ASTContext so it can't run standalone via cir-opt.

https://github.com/llvm/llvm-project/pull/219078


More information about the cfe-commits mailing list