]> granicus.if.org Git - clang/commit
[X86] Make `x86intrin.h`, `immintrin.h` includable with `-fno-gnu-inline-asm`.
authorVolodymyr Sapsai <vsapsai@apple.com>
Mon, 13 May 2019 22:40:11 +0000 (22:40 +0000)
committerVolodymyr Sapsai <vsapsai@apple.com>
Mon, 13 May 2019 22:40:11 +0000 (22:40 +0000)
commit8a3369cdc081f4995fe154f21d2c5039824edfaa
tree7e85f392635a5f3be87d030b56f803a7e9830a82
parentc770c8882d4f8cbcb4eca8a26f9dcaf2f6d8fa12
[X86] Make `x86intrin.h`, `immintrin.h` includable with `-fno-gnu-inline-asm`.

Currently `immintrin.h` includes `pconfigintrin.h` and `sgxintrin.h`
which contain inline assembly. It causes failures when building with the
flag `-fno-gnu-inline-asm`.

Fix by excluding functions with inline assembly when this extension is
disabled. So far there was no need to support `_pconfig_u32`,
`_enclu_u32`, `_encls_u32`, `_enclv_u32` on platforms that require
`-fno-gnu-inline-asm`. But if developers start using these functions,
they'll have compile-time undeclared identifier errors which is
preferrable to runtime errors.

rdar://problem/49540880

Reviewers: craig.topper, GBuella, rnk, echristo

Reviewed By: rnk

Subscribers: jkorous, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360630 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Headers/immintrin.h
lib/Headers/pconfigintrin.h
lib/Headers/sgxintrin.h
test/Modules/compiler_builtins_x86.c