about summary refs log tree commit diff homepage
path: root/include/klee/Support/Casting.h
blob: 865218a0651a10e99c8bdbb9dc0539e42e8ff2d7 (plain) (blame)
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
//===-- Casting.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_CASTING_H
#define KLEE_CASTING_H

#include "klee/Config/Version.h"

#include "llvm/Support/Casting.h"

namespace klee {

using llvm::cast;
using llvm::cast_or_null;
using llvm::dyn_cast;
using llvm::dyn_cast_or_null;
using llvm::isa;
#if LLVM_VERSION_CODE >= LLVM_VERSION(9, 0)
using llvm::isa_and_nonnull;
#else
template <typename... X, typename Y>
inline bool isa_and_nonnull(const Y &value) {
  return value && isa<X...>(value);
}
#endif

} // namespace klee

#endif /* KLEE_CASTING_H */