https://github.com/Sirraide created 
https://github.com/llvm/llvm-project/pull/172164

There is currently no way to actually access `ASTUnit::CodeGenOpts`; this is 
almost certainly an oversight, so this adds a getter for it.

>From 7084d1a1a966342a26b6b02a076961d3fc808db8 Mon Sep 17 00:00:00 2001
From: Sirraide <[email protected]>
Date: Sat, 13 Dec 2025 18:24:57 +0100
Subject: [PATCH] [Clang] Add an accessor for 'ASTUnit::CodeGenOpts'

---
 clang/include/clang/Frontend/ASTUnit.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/clang/include/clang/Frontend/ASTUnit.h 
b/clang/include/clang/Frontend/ASTUnit.h
index 341460e1962cb..0e3c52ae59320 100644
--- a/clang/include/clang/Frontend/ASTUnit.h
+++ b/clang/include/clang/Frontend/ASTUnit.h
@@ -476,6 +476,11 @@ class ASTUnit {
     return *LangOpts;
   }
 
+  const CodeGenOptions &getCodeGenOpts() const {
+    assert(CodeGenOpts && "ASTUnit does not have codegen options");
+    return *CodeGenOpts;
+  }
+
   const HeaderSearchOptions &getHeaderSearchOpts() const {
     assert(HSOpts && "ASTUnit does not have header search options");
     return *HSOpts;

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to