You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Clang 18 LibTooling编程调用时如何抑制“Processing file”提示信息?

解决Clang 18 LibTooling处理文件时的进度提示问题

升级到Clang 18后,LibTooling默认开启了文件处理进度提示,要抑制这类"[X/Y] Processing file..."消息,有两种实用方法:

  • 通过命令行参数禁用:在构建ClangTool的参数列表中添加-no-progress-display参数,示例代码:

    // 准备编译参数
    std::vector<std::string> compileArgs = {
        "-no-progress-display",
        "-std=c++17",
        // 其他编译选项...
    };
    ClangTool tool(compilations, targetFiles, compileArgs);
    
  • 通过API直接配置:设置ToolingOptions的ShowProgress字段为false,无需额外命令行参数,示例代码:

    ClangTool tool(compilations, targetFiles);
    ToolingOptions opts;
    opts.ShowProgress = false;
    tool.setToolingOptions(opts);
    

这两种方式都能完全屏蔽掉进度提示输出,根据你的代码结构选合适的就行。

内容的提问来源于stack exchange,提问作者dimgel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 10:42:35