简体   繁体   English

有没有办法用clang有效地编译已经预处理的文件?

[英]Is there a way to efficiently compile already preprocessed file with clang?

I got a preprocessed file with command: clang++ -E test.cc > test.E Then I want to quickly compile it. 我得到了一个带有命令的预处理文件: clang++ -E test.cc > test.E然后我想快速编译它。 To do it, I run clang++ -### -c test.cc , then I take all those flags and just replace input file name from test.cc to test.E . 为此,我运行clang++ -### -c test.cc ,然后使用所有这些标志并将输入文件名从test.cctest.E

But I wonder, if there are some redundant flags in output of clang++ -### for already preprocessed file, or may be there are some flags, that force clang to skip preprocessing or some other unnecessary steps. 但是我想知道,如果在clang++ -###输出中已经预处理过的文件中存在一些多余的标志,或者可能存在一些标志,这会迫使clang跳过预处理或其他不必要的步骤。

The aim is to speed up the compilation of a preprocessed file. 目的是加快预处理文件的编译。

为了加快编译速度,我需要将标志的“ -x”参数替换为正确的语言,例如:“ c”->“ cpp-output”,“ c ++”->“ c ++-cpp-output”等。在这种情况下,clang根本不会运行预处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MSVS C ++,如何使用* .i扩展名编译已经预处理的文件? - MSVS C++, how to compile already-preprocessed file with *.i extension? 如何在Linux中编译后以这样的方式编译c / cpp代码以提供经过预处理的汇编文件和目标文件? - how to compile c/cpp code in such a way that it gives preprocessed assembled and object file after compilation in linux? 如何使用VS编译器将预处理文件编译为目标文件 - How to compile a preprocessed file into object file using VS compiler 有没有办法使用Clang减少编译器错误测试用例的预处理源的大小? - Is there a way to reduce the size of a preprocessed source of a compiler bug test case using Clang? 无法使用clang编译简单文件 - can't compile simple file with clang 使用 clang 编译 .cl 内核文件 - Using clang to compile .cl kernel file 如何输出预处理的代码并进行编译(Visual Studio) - How to output preprocessed code AND compile it (Visual Studio) 有没有办法在输出二进制文件中存储clang编译时标志? - Is there a way to store clang compile-time flags in the output binary? 有没有办法让 G++/clang++ 的编译时间和 MSVC 一样快? - Is there a way to make G++/clang++ compile times as fast as MSVC? 编译先前预处理的文件更改输出 - Compiling previously preprocessed file changes output
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM