jessevdk / cldoc

clang based documentation generator for C and C++
GNU General Public License v2.0
553 stars 59 forks source link

undeclared identifier with xmmintrin.h #113

Closed ScottDillman closed 6 years ago

ScottDillman commented 8 years ago

I'm actually having problems with this header being included somewhere deep down in the project hierarchy, but paired the problem down to a simple example.

#include <x86intrin.h>

int main(int argc, char *argv[])
{
    return 0;
}

executing the following command line:

cldoc generate -m64 -I/usr/lib/llvm-3.6/lib/clang/3.6.2/include -- --type html --loglevel info --language c++ test.cpp --output ./test

generates the following errors:

usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:185:18: error: use of undeclared identifier '__builtin_ia32_cmpeqss'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:191:18: error: use of undeclared identifier '__builtin_ia32_cmpeqps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:197:18: error: use of undeclared identifier '__builtin_ia32_cmpltss'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:203:18: error: use of undeclared identifier '__builtin_ia32_cmpltps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:209:18: error: use of undeclared identifier '__builtin_ia32_cmpless'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:215:18: error: use of undeclared identifier '__builtin_ia32_cmpleps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:222:42: error: use of undeclared identifier '__builtin_ia32_cmpltss'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:229:18: error: use of undeclared identifier '__builtin_ia32_cmpltps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:236:42: error: use of undeclared identifier '__builtin_ia32_cmpless'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:243:18: error: use of undeclared identifier '__builtin_ia32_cmpleps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:249:18: error: use of undeclared identifier '__builtin_ia32_cmpneqss'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:255:18: error: use of undeclared identifier '__builtin_ia32_cmpneqps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:261:18: error: use of undeclared identifier '__builtin_ia32_cmpnltss'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:267:18: error: use of undeclared identifier '__builtin_ia32_cmpnltps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:273:18: error: use of undeclared identifier '__builtin_ia32_cmpnless'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:279:18: error: use of undeclared identifier '__builtin_ia32_cmpnleps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:286:42: error: use of undeclared identifier '__builtin_ia32_cmpnltss'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:293:18: error: use of undeclared identifier '__builtin_ia32_cmpnltps'
/usr/lib/llvm-3.6/lib/clang/3.6.2/include/xmmintrin.h:300:42: error: use of undeclared identifier '__builtin_ia32_cmpnless'
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Could not generate documentation due to parser errors

Executing clang like the following:

clang -I/usr/lib/llvm-3.6/lib/clang/3.6.2/include test.cpp  

builds cleanly..

I'm relatively new to clang so it could be operator error, but scouring the usual sources for solutions turned up nothing

ScottDillman commented 8 years ago

I discovered I have clang 3.6 installed and added '3.6' to the array here:

https://github.com/jessevdk/cldoc/blob/master/cldoc/tree.py#L53

which solved the problem..

jessevdk commented 6 years ago

All recent versions of clang are now added in the search for the library. This issue should be resolved.