include-what-you-use / include-what-you-use

A tool for use with clang to analyze #includes in C and C++ source files
https://include-what-you-use.org
Other
4.12k stars 387 forks source link

export pragma interferes with mapping #139

Open vsapsai opened 9 years ago

vsapsai commented 9 years ago

Originally reported on Google Code with ID 139

Given:
//simd.h:
#include <immintrin.h> // IWYU pragma: export
__m128 a;
//simd.imp:
[{ include: ["<xmmintrin.h>", "public", "<immintrin.h>", "public"] }]

I get:
simd.h should add these lines:
#include <xmmintrin.h>                  // for __m128

Without the export pragma the mapping works correctly and I don't get that incorrect
suggestion. This is both with 3.4.1 and HEAD. Also it is both with angle and double
quotes. It also doesn't matter whether the mapping is from public or from private.

Reported by roland@rschulz.eu on 2014-05-30 04:09:55

vsapsai commented 9 years ago
PS: One should run IWYU as:
include-what-you-use simd.h -mavx -Xiwyu --mapping_file=simd.imp

Reported by roland@rschulz.eu on 2014-05-30 04:28:28