[PATCH] D91851: [compiler-rt] [emutls] Add ifdefs around msvc specific pragmas
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 24 02:13:58 PST 2020
mstorsjo added a comment.
In D91851#2412605 <https://reviews.llvm.org/D91851#2412605>, @compnerd wrote:
> clang -target x86_64-unknown-windows-itanium -x c -E - -dM <<< '' | grep _MSC_VER
>
> This is the reason that I prefer the "inverted" logic.
Ah, I see.
However, the itanium mode doesn't actually seems to support these pragmas either:
$ cat pragma.c
#pragma warning(push)
#pragma warning(disable : 4206)
#pragma warning(pop)
$ bin/clang -target x86_64-windows-msvc -c pragma.c -Wall
$ bin/clang -target x86_64-windows-gnu -c pragma.c -Wall
pragma.c:1:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma warning(push)
^
pragma.c:2:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma warning(disable : 4206)
^
pragma.c:3:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma warning(pop)
^
3 warnings generated.
$ bin/clang -target x86_64-windows-itanium -c pragma.c -Wall
pragma.c:1:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma warning(push)
^
pragma.c:2:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma warning(disable : 4206)
^
pragma.c:3:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma warning(pop)
^
3 warnings generated.
So with that in mind, the `_MSC_VER` check should actually be the right one, that silences the warning on itanium too?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91851/new/
https://reviews.llvm.org/D91851
More information about the llvm-commits
mailing list