================ @@ -46,6 +49,38 @@ bool Definition::set_isDisabled(bool disable) { return was; } +void Definition::Print( + llvm::raw_ostream &out, llvm::StringRef macroName) const { + if (!isFunctionLike_) { + // If it's not a function-like macro, then just print the replacement. + out << ' ' << replacement_.ToString(); + return; + } + + size_t argCount{argumentCount()}; + + out << '('; + for (size_t i{0}; i != argCount; ++i) { + if (i != 0) { + out << ", "; + } + out << argNames_[i]; + } + if (isVariadic_) { + out << ", ..."; + } + out << ") "; + + for (size_t i{0}, e{replacement_.SizeInTokens()}; i != e; ++i) { + std::string tok{replacement_.TokenAt(i).ToString()}; + if (size_t idx = getArgumentIndex(tok); idx < argCount) { ---------------- klausler wrote:
`std::size_t idx {GetArgumentIndex(Tok)}; ...` https://github.com/llvm/llvm-project/pull/87627 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits