-
Notifications
You must be signed in to change notification settings - Fork 170
/
Copy pathLLVMWarningsPop.hpp
46 lines (39 loc) · 1.42 KB
/
LLVMWarningsPop.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*========================== begin_copyright_notice ============================
Copyright (C) 2017-2021 Intel Corporation
SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/
// Disable warnings specific to llvm headers
//
// Use it like this:
// | #include "Common/Debug/Debug.hpp"
// |
// | #include "Common/LLVMWarningsPush.hpp"
// | #include <llvm/IR/Function.h>
// | #include <llvm/IR/Instruction.h>
// | #include <llvm/DerivedTypes.h>
// | #include <llvm/IR/Intrinsics.h>
// | #include "Common/LLVMWarningsPop.hpp"
// |
// | #include <vector>
// |
// | // Rest of implementation
//
// This enables us to turn on -Werror without fixing all of the places inside
// llvm itself where warning level 3 would normally complain.
// Do some checking to make sure the includes are in the right order
// It is super easy to get this wrong...
#if !defined( LLVM_WARNINGS_PUSH )
# error "Improperly structured LLVMWarnings{Push,Pop}.hpp includes ( pop included, with no prior push included )"
#endif
#if defined( LLVM_WARNINGS_POP )
# error "Improperly structured LLVMWarnings{Push,Pop}.hpp includes ( pop included twice with no push inbetween )"
#endif
#define LLVM_WARNINGS_POP
#undef LLVM_WARNINGS_PUSH
// Do the actual pop
#ifdef _MSC_VER
# pragma warning( pop )
#endif
#if defined(__linux__)
# pragma GCC diagnostic pop
#endif