Move DataTypes.h to include/llvm/System, update all users. This breaks the last
[oota-llvm.git] / include / llvm / ExecutionEngine / GenericValue.h
index 9cd0672e93c1228e1363129dbf26ca02a6b79d6b..1301320c1435c377c68755b934c2d6fa90295dfc 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
 #ifndef GENERIC_VALUE_H
 #define GENERIC_VALUE_H
 
-#include "llvm/Support/DataTypes.h"
+#include "llvm/ADT/APInt.h"
+#include "llvm/System/DataTypes.h"
 
 namespace llvm {
 
-typedef uintptr_t PointerTy;
-
-union GenericValue {
-  bool            Int1Val;
-  unsigned char   Int8Val;
-  unsigned short  Int16Val;
-  unsigned int    Int32Val;
-  uint64_t        Int64Val;
-  double          DoubleVal;
-  float           FloatVal;
-  struct { unsigned int first; unsigned int second; } UIntPairVal;
-  PointerTy       PointerVal;
-  unsigned char   Untyped[8];
-
-  GenericValue() {}
-  GenericValue(void *V) {
-    PointerVal = (PointerTy)(intptr_t)V;
-  }
+typedef void* PointerTy;
+class APInt;
+
+struct GenericValue {
+  union {
+    double          DoubleVal;
+    float           FloatVal;
+    PointerTy       PointerVal;
+    struct { unsigned int first; unsigned int second; } UIntPairVal;
+    unsigned char   Untyped[8];
+  };
+  APInt IntVal;   // also used for long doubles
+
+  GenericValue() : DoubleVal(0.0), IntVal(1,0) {}
+  explicit GenericValue(void *V) : PointerVal(V), IntVal(1,0) { }
 };
 
 inline GenericValue PTOGV(void *P) { return GenericValue(P); }
-inline void* GVTOP(const GenericValue &GV) {
-  return (void*)(intptr_t)GV.PointerVal;
-}
+inline void* GVTOP(const GenericValue &GV) { return GV.PointerVal; }
 
 } // End llvm namespace
 #endif