llvm-project/llvm/tools
Martin Storsjo 518b6c9882 [llvm-rc] Handle C preprocessor output
When preprocessing resource scripts (which can easily be done outside
of llvm-rc), included headers can leave behind C declarations (despite
preprocessing with -DRC_INVOKED), that can't be parsed by a resource
compiler.

This is handled in all of rc.exe, by parsing the preprocessor output
line markers and ignoring content from files named *.h and *.c,
documented at [1].

In addition to this filtering, strip out any other preprocessor directive
that is left behind (like pragmas) which also can't be handled by the
tokenizer.

The added test uses both standard #line markers (supported by rc.exe) and
GNU style extended line markers, thus this test doesn't pass with rc.exe,
but passes with GNU windres. (Windres on the other hand doesn't filter
out files named *.c, only *.h.)

Differential Revision: https://reviews.llvm.org/D46579

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa381033(v=vs.85).aspx

llvm-svn: 331903
2018-05-09 18:21:03 +00:00
..
bugpoint Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
bugpoint-passes Remove redundant includes from tools. 2017-12-13 21:31:10 +00:00
dsymutil Remove LLVM_INSTALL_CCTOOLS_SYMLINKS 2018-04-24 15:41:02 +00:00
gold [LTO] Add stats-file option to LTO/Config.h. 2018-04-20 10:18:36 +00:00
llc Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
lli IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
llvm-ar Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-as Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-as-fuzzer cmake: Invent add_llvm_fuzzer to set up fuzzer targets 2017-08-31 00:36:33 +00:00
llvm-bcanalyzer [bcanalyzer] Recognize more stream types 2018-04-21 23:52:04 +00:00
llvm-c-test [LLVM-C] Eliminate an unused variable in a test. 2018-04-29 02:01:34 +00:00
llvm-cat Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-cfi-verify Make llvm-cfi-verify CMakeLists.txt formatting more consistent with the rest of LLVM. 2018-05-09 01:07:02 +00:00
llvm-config Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
llvm-cov Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
llvm-cvtres [llvm-cvtres] Allow parameters preceded by '-' in addition to '/' 2018-05-02 21:15:13 +00:00
llvm-cxxdump Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-cxxfilt Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-demangle-fuzzer llvm-demangle-fuzzer: Link in Support 2017-11-17 20:46:55 +00:00
llvm-diff Let llvm-diff correctly deal with Undef/ConstantAggregateZero/ConstantVector/IndirectBr 2018-04-12 21:28:04 +00:00
llvm-dis [tools] Use WithColor for printing errors. 2018-04-21 21:11:59 +00:00
llvm-dwarfdump [DebugInfo] Accept `S` in augmentation strings in CIE. 2018-05-08 06:21:12 +00:00
llvm-dwp [llvm-dwp] Define InitLLVM. 2018-05-06 23:08:29 +00:00
llvm-exegesis Re-land r331622 "[llvm-exegesis] Add a library to cluster benchmark results." 2018-05-07 09:09:48 +00:00
llvm-extract Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-go Update some code.google.com links 2017-11-13 23:47:58 +00:00
llvm-isel-fuzzer Rename *CommandFlags.def to *CommandFlags.inc 2018-04-11 18:49:37 +00:00
llvm-jitlistener Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-link [llvm-link] Use WithColor for printing errors 2018-04-18 14:41:47 +00:00
llvm-lto Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
llvm-lto2 [LTO] Allow pass remarks with hotness to be set when emitting to stderr 2018-05-04 23:59:34 +00:00
llvm-mc [MC] Change AsmParser to leverage Assembler during evaluation 2018-04-30 19:22:40 +00:00
llvm-mc-assemble-fuzzer [llvm-mc-assemble-fuzzer] Catch up with API changes. 2018-05-04 23:41:25 +00:00
llvm-mc-disassemble-fuzzer cmake: Invent add_llvm_fuzzer to set up fuzzer targets 2017-08-31 00:36:33 +00:00
llvm-mca llvm-mca: Add missing includes 2018-05-09 17:28:10 +00:00
llvm-modextract Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-mt Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-nm Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-objcopy [llvm-objcopy] Fix exit code 2018-05-08 17:12:54 +00:00
llvm-objdump Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
llvm-opt-fuzzer Link to AggressiveInstCombine in a few places. Unbreaks build for me. 2018-04-24 08:40:37 +00:00
llvm-opt-report Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
llvm-pdbutil llvm-pdbutil: Fix an off-by-one error. 2018-04-17 21:44:17 +00:00
llvm-profdata [llvm-profdata] Use WithColor for printing errors 2018-04-18 14:42:33 +00:00
llvm-rc [llvm-rc] Handle C preprocessor output 2018-05-09 18:21:03 +00:00
llvm-readobj [WebAssembly] llvm-readobj: display symbols names in relocations 2018-05-01 16:35:16 +00:00
llvm-rtdyld Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-shlib Rename llvm library from libLLVM-X.Y to libLLVM-X 2018-03-29 09:44:09 +00:00
llvm-size Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-special-case-list-fuzzer [llvm-special-case-list-fuzzer] Add fuzz target. 2017-10-17 17:43:34 +00:00
llvm-split Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-stress [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-strings Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-symbolizer Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-xray Inline contents of LLVM_XRAY_TOOLS variable into its only use. 2018-05-09 00:42:17 +00:00
lto s/LLVM_ON_WIN32/_WIN32/, llvm 2018-04-29 00:45:03 +00:00
msbuild Create msbuild only when using MSVC 2017-03-16 20:24:14 +00:00
obj2yaml obj2yaml: Correctly round-trip default alignment. 2018-05-04 16:28:41 +00:00
opt Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
opt-viewer [opt-viewer] Kill parser processes before moving onto rendering 2018-02-26 21:15:51 +00:00
sancov Rename sancov.cc to sancov.cpp 2018-04-25 18:06:23 +00:00
sanstats Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
verify-uselistorder Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
xcode-toolchain [llvm] Add stripped installation targets 2017-11-30 21:48:26 +00:00
yaml2obj Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
CMakeLists.txt
LLVMBuild.txt Re-land r329156 "Add llvm-exegesis tool." 2018-04-04 11:37:06 +00:00