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