about summary refs log tree commit diff homepage
path: root/lib/Core/Context.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Core/Context.h')
-rw-r--r--lib/Core/Context.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/Core/Context.h b/lib/Core/Context.h
new file mode 100644
index 00000000..af1ce8e7
--- /dev/null
+++ b/lib/Core/Context.h
@@ -0,0 +1,45 @@
+//===-- Context.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_CONTEXT_H
+#define KLEE_CONTEXT_H
+
+#include "klee/Expr.h"
+
+namespace klee {
+
+  /// Context - Helper class for storing global information about a KLEE run.
+  class Context {
+    /// Whether the target architecture is little endian or not.
+    bool IsLittleEndian;
+
+    /// The pointer width of the target architecture.
+    Expr::Width PointerWidth;
+
+  protected:
+    Context(bool _IsLittleEndian, Expr::Width _PointerWidth)
+      : IsLittleEndian(_IsLittleEndian), PointerWidth(_PointerWidth) {}
+    
+  public:
+    Context() {}
+    
+    /// initialize - Construct the global Context instance.
+    static void initialize(bool IsLittleEndian, Expr::Width PointerWidth);
+
+    /// get - Return the global singleton instance of the Context.
+    static const Context &get();
+
+    bool isLittleEndian() const { return IsLittleEndian; }
+
+    Expr::Width getPointerWidth() const { return PointerWidth; }
+  };
+  
+} // End klee namespace
+
+#endif