about summary refs log tree commit diff homepage
path: root/runtime
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2020-06-01 16:41:40 +0200
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2020-10-12 11:19:24 +0100
commite94d9c6268cb75ff317a42e26f33c419e6686b5d (patch)
tree346d23eac905484f73bebca6445313ef46a7ae37 /runtime
parent20d08cbef08993340d15855941fa7fe2c86d9f59 (diff)
downloadklee-e94d9c6268cb75ff317a42e26f33c419e6686b5d.tar.gz
fix cxa_exception include for older LLVM versions
Diffstat (limited to 'runtime')
-rw-r--r--runtime/klee-eh-cxx/klee_eh_cxx.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/klee-eh-cxx/klee_eh_cxx.cpp b/runtime/klee-eh-cxx/klee_eh_cxx.cpp
index 8eafac2c..5dec6050 100644
--- a/runtime/klee-eh-cxx/klee_eh_cxx.cpp
+++ b/runtime/klee-eh-cxx/klee_eh_cxx.cpp
@@ -9,7 +9,17 @@
 #include <klee/klee.h>
 
 // from libcxxabi
-#include <cxa_exception.h>
+#ifdef __has_include
+#  if __has_include(<cxa_exception.h>)
+#    include <cxa_exception.h> // renamed with LLVM 10
+#  elif __has_include(<cxa_exception.hpp>)
+#    include <cxa_exception.hpp>
+#  else
+#    error "missing 'cxa_exception' header from libcxxabi"
+#  endif
+#else
+#  include <cxa_exception.hpp> // assume old name
+#endif
 #include <private_typeinfo.h>
 
 // implemented in the SpecialFunctionHandler
@@ -215,4 +225,4 @@ _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *context) {
   klee_report_error(__FILE__, __LINE__, "_Unwind_GetRegionStart not supported",
                     "unsupported.err");
 }
-}
\ No newline at end of file
+}