about summary refs log tree commit diff homepage
path: root/include
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2023-03-27 15:21:51 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-04-06 16:03:03 +0300
commit81ff90b3fc4f38abea2ab9472924dcdf0d1f10fe (patch)
tree233c37c1339142a86089fc7ef2bedd2bd95456b3 /include
parent2769f1f4dc3515a8b5fc22ccf3e30b906faef75d (diff)
downloadklee-81ff90b3fc4f38abea2ab9472924dcdf0d1f10fe.tar.gz
Support disabling compiler warnings; Use with external headers
Diffstat (limited to 'include')
-rw-r--r--include/klee/Expr/Expr.h5
-rw-r--r--include/klee/Module/KCallable.h4
-rw-r--r--include/klee/Solver/SolverCmdLine.h4
-rw-r--r--include/klee/Support/CompilerWarning.h33
-rw-r--r--include/klee/Support/FileHandling.h5
-rw-r--r--include/klee/Support/ModuleUtil.h4
-rw-r--r--include/klee/Support/OptionCategories.h4
-rw-r--r--include/klee/Support/PrintVersion.h4
-rw-r--r--include/klee/System/Time.h4
9 files changed, 67 insertions, 0 deletions
diff --git a/include/klee/Expr/Expr.h b/include/klee/Expr/Expr.h
index ae2760a2..15075eb8 100644
--- a/include/klee/Expr/Expr.h
+++ b/include/klee/Expr/Expr.h
@@ -12,12 +12,17 @@
 
 #include "klee/ADT/Bits.h"
 #include "klee/ADT/Ref.h"
+
+#include "klee/Support/CompilerWarning.h"
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/raw_ostream.h"
+DISABLE_WARNING_POP
 
 #include <sstream>
 #include <set>
diff --git a/include/klee/Module/KCallable.h b/include/klee/Module/KCallable.h
index 6fe8419d..ade28cfc 100644
--- a/include/klee/Module/KCallable.h
+++ b/include/klee/Module/KCallable.h
@@ -12,10 +12,14 @@
 
 #include <string>
 
+#include "klee/Support/CompilerWarning.h"
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/ADT/Twine.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/InlineAsm.h"
 #include "llvm/IR/LLVMContext.h"
+DISABLE_WARNING_POP
 
 namespace klee {
 /// Wrapper for callable objects passed in callExternalFunction
diff --git a/include/klee/Solver/SolverCmdLine.h b/include/klee/Solver/SolverCmdLine.h
index b453d058..90c162ee 100644
--- a/include/klee/Solver/SolverCmdLine.h
+++ b/include/klee/Solver/SolverCmdLine.h
@@ -16,9 +16,13 @@
 #define KLEE_SOLVERCMDLINE_H
 
 #include "klee/Config/config.h"
+#include "klee/Support/CompilerWarning.h"
 
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/CommandLine.h"
+DISABLE_WARNING_POP
 
 namespace klee {
 
diff --git a/include/klee/Support/CompilerWarning.h b/include/klee/Support/CompilerWarning.h
new file mode 100644
index 00000000..ce192292
--- /dev/null
+++ b/include/klee/Support/CompilerWarning.h
@@ -0,0 +1,33 @@
+//===-- CompilerWarning.h ---------------------------------------*- C++ -*-===//
+//
+//                     The KLEE Symbolic Virtual Machine
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef KLEE_INCLUDE_KLEE_SUPPORT_COMPILERWARNING_H
+#define KLEE_INCLUDE_KLEE_SUPPORT_COMPILERWARNING_H
+
+// Disables different warnings
+#if defined(__GNUC__) || defined(__clang__)
+#define ENABLE_PRAGMA(X) _Pragma(#X)
+#define DISABLE_WARNING_PUSH ENABLE_PRAGMA(GCC diagnostic push)
+#define DISABLE_WARNING_POP ENABLE_PRAGMA(GCC diagnostic pop)
+#define DISABLE_WARNING(warningName)                                           \
+  ENABLE_PRAGMA(GCC diagnostic ignored #warningName)
+
+#define DISABLE_WARNING_DEPRECATED_DECLARATIONS                                \
+  DISABLE_WARNING(-Wdeprecated-declarations)
+
+#else
+
+#define DISABLE_WARNING_PUSH
+#define DISABLE_WARNING_POP
+#define DISABLE_WARNING(warningName)
+
+#define DISABLE_WARNING_DEPRECATED_DECLARATIONS
+#endif
+
+#endif // KLEE_INCLUDE_KLEE_SUPPORT_COMPILERWARNING_H
diff --git a/include/klee/Support/FileHandling.h b/include/klee/Support/FileHandling.h
index 90ce20b3..a0dd0e95 100644
--- a/include/klee/Support/FileHandling.h
+++ b/include/klee/Support/FileHandling.h
@@ -10,7 +10,12 @@
 #ifndef KLEE_FILEHANDLING_H
 #define KLEE_FILEHANDLING_H
 
+#include "klee/Support/CompilerWarning.h"
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/Support/raw_ostream.h"
+DISABLE_WARNING_POP
+
 #include <memory>
 #include <string>
 
diff --git a/include/klee/Support/ModuleUtil.h b/include/klee/Support/ModuleUtil.h
index 328b9aeb..f1c4c407 100644
--- a/include/klee/Support/ModuleUtil.h
+++ b/include/klee/Support/ModuleUtil.h
@@ -12,8 +12,12 @@
 
 #include "klee/Config/Version.h"
 
+#include "klee/Support/CompilerWarning.h"
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Module.h"
+DISABLE_WARNING_POP
 
 #include <memory>
 #include <string>
diff --git a/include/klee/Support/OptionCategories.h b/include/klee/Support/OptionCategories.h
index 40f3deb8..bde9a4eb 100644
--- a/include/klee/Support/OptionCategories.h
+++ b/include/klee/Support/OptionCategories.h
@@ -14,7 +14,11 @@
 #ifndef KLEE_OPTIONCATEGORIES_H
 #define KLEE_OPTIONCATEGORIES_H
 
+#include "klee/Support/CompilerWarning.h"
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/Support/CommandLine.h"
+DISABLE_WARNING_POP
 
 namespace klee {
   extern llvm::cl::OptionCategory DebugCat;
diff --git a/include/klee/Support/PrintVersion.h b/include/klee/Support/PrintVersion.h
index 1c952451..f4999deb 100644
--- a/include/klee/Support/PrintVersion.h
+++ b/include/klee/Support/PrintVersion.h
@@ -10,7 +10,11 @@
 #ifndef KLEE_PRINTVERSION_H
 #define KLEE_PRINTVERSION_H
 
+#include "klee/Support/CompilerWarning.h"
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/Support/raw_ostream.h"
+DISABLE_WARNING_POP
 
 #include "klee/Config/Version.h"
 
diff --git a/include/klee/System/Time.h b/include/klee/System/Time.h
index 2ebebdfd..14d9ab4b 100644
--- a/include/klee/System/Time.h
+++ b/include/klee/System/Time.h
@@ -10,7 +10,11 @@
 #ifndef KLEE_TIME_H
 #define KLEE_TIME_H
 
+#include "klee/Support/CompilerWarning.h"
+DISABLE_WARNING_PUSH
+DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/Support/raw_ostream.h"
+DISABLE_WARNING_POP
 
 #include <chrono>
 #include <string>