[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 29 10:22:31 PDT 2025
jansvoboda11 wrote:
> Also looks like [this assert](https://github.com/llvm/llvm-project/blob/14469a8726fc1d038f41c7e3e29a84ec8f52d013/clang/include/clang/Frontend/ASTUnit.h#L472) doesn't serve its value anymore
>
> ```c++
> const LangOptions &getLangOpts() const {
> assert(LangOpts && "ASTUnit does not have language options");
> return *LangOpts;
> }
> ```
>
> But it is a minor cleanup, not blocking.
I think it still does have a value because `LangOpts` is not initialized in the constructor and only gets initialized conditionally. So there still are times where it's null.
https://github.com/llvm/llvm-project/pull/137675
More information about the cfe-commits
mailing list