diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-24 00:01:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-24 00:01:05 +0000 |
commit | bd199fb1148b9e16c4e6f3d0ee386c2505a55b71 (patch) | |
tree | 226f64cc95160ebd8da8d2ec4cfaf2babf7c3879 /include/llvm/ExecutionEngine/GenericValue.h | |
parent | fe11a97fcde7c63109c3ad36570657807d0cd6ef (diff) |
Initial checkin of new LLI with JIT compiler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ExecutionEngine/GenericValue.h')
-rw-r--r-- | include/llvm/ExecutionEngine/GenericValue.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/llvm/ExecutionEngine/GenericValue.h b/include/llvm/ExecutionEngine/GenericValue.h new file mode 100644 index 0000000000..f5e70e5fd5 --- /dev/null +++ b/include/llvm/ExecutionEngine/GenericValue.h @@ -0,0 +1,40 @@ +//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===// +// +// The GenericValue class is used to represent an LLVM value of arbitrary type. +// +//===----------------------------------------------------------------------===// + + +#ifndef GENERIC_VALUE_H +#define GENERIC_VALUE_H + +#include "Support/DataTypes.h" + +typedef uint64_t PointerTy; + +union GenericValue { + bool BoolVal; + unsigned char UByteVal; + signed char SByteVal; + unsigned short UShortVal; + signed short ShortVal; + unsigned int UIntVal; + signed int IntVal; + uint64_t ULongVal; + int64_t LongVal; + double DoubleVal; + float FloatVal; + PointerTy PointerVal; + unsigned char Untyped[8]; + + GenericValue() {} + GenericValue(void *V) { + PointerVal = (PointerTy)(intptr_t)V; + } +}; + +inline GenericValue PTOGV(void *P) { return GenericValue(P); } +inline void* GVTOP(const GenericValue &GV) { + return (void*)(intptr_t)GV.PointerVal; +} +#endif |