[clang] [Preprocessor] Do not expand macros if the input is already preprocessed (PR #137665)
Juan Manuel Martinez CaamaƱo via cfe-commits
cfe-commits at lists.llvm.org
Thu May 22 07:58:00 PDT 2025
================
@@ -1558,6 +1558,13 @@ void clang::InitializePreprocessor(Preprocessor &PP,
const PCHContainerReader &PCHContainerRdr,
const FrontendOptions &FEOpts,
const CodeGenOptions &CodeGenOpts) {
+
+ if (all_of(FEOpts.Inputs,
+ [](const FrontendInputFile &FI) { return FI.isPreprocessed(); })) {
+ PP.SetDisableMacroExpansion();
+ return;
+ }
----------------
jmmartinez wrote:
You're right, it makes more sense there. I've updated it to match.
https://github.com/llvm/llvm-project/pull/137665
More information about the cfe-commits
mailing list