Add a flag to MBBs to indicate whether it is an eh landing pad.
[oota-llvm.git] / include / llvm / ExecutionEngine / GenericValue.h
1 //===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // The GenericValue class is used to represent an LLVM value of arbitrary type.
11 //
12 //===----------------------------------------------------------------------===//
13
14
15 #ifndef GENERIC_VALUE_H
16 #define GENERIC_VALUE_H
17
18 #include "llvm/Support/DataTypes.h"
19
20 namespace llvm {
21
22 typedef uintptr_t PointerTy;
23
24 union GenericValue {
25   bool            Int1Val;
26   unsigned char   Int8Val;
27   unsigned short  Int16Val;
28   unsigned int    Int32Val;
29   uint64_t        Int64Val;
30   double          DoubleVal;
31   float           FloatVal;
32   struct { unsigned int first; unsigned int second; } UIntPairVal;
33   PointerTy       PointerVal;
34   unsigned char   Untyped[8];
35
36   GenericValue() {}
37   GenericValue(void *V) {
38     PointerVal = (PointerTy)(intptr_t)V;
39   }
40 };
41
42 inline GenericValue PTOGV(void *P) { return GenericValue(P); }
43 inline void* GVTOP(const GenericValue &GV) {
44   return (void*)(intptr_t)GV.PointerVal;
45 }
46
47 } // End llvm namespace
48 #endif