LLVM
4.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
llvm.src
include
llvm
ExecutionEngine
GenericValue.h
Go to the documentation of this file.
1
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// 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 LLVM_EXECUTIONENGINE_GENERICVALUE_H
16
#define LLVM_EXECUTIONENGINE_GENERICVALUE_H
17
18
#include "
llvm/ADT/APInt.h
"
19
#include "llvm/Support/DataTypes.h"
20
#include <vector>
21
22
namespace
llvm {
23
24
typedef
void
*
PointerTy
;
25
class
APInt
;
26
27
struct
GenericValue
{
28
struct
IntPair
{
29
unsigned
int
first
;
30
unsigned
int
second
;
31
};
32
union
{
33
double
DoubleVal
;
34
float
FloatVal
;
35
PointerTy
PointerVal
;
36
struct
IntPair
UIntPairVal
;
37
unsigned
char
Untyped
[8];
38
};
39
APInt
IntVal
;
// also used for long doubles.
40
// For aggregate data types.
41
std::vector<GenericValue>
AggregateVal
;
42
43
// to make code faster, set GenericValue to zero could be omitted, but it is
44
// potentially can cause problems, since GenericValue to store garbage
45
// instead of zero.
46
GenericValue
() :
IntVal
(1,0) {
UIntPairVal
.
first
= 0;
UIntPairVal
.
second
= 0;}
47
explicit
GenericValue
(
void
*V) :
PointerVal
(V),
IntVal
(1,0) { }
48
};
49
50
inline
GenericValue
PTOGV
(
void
*
P
) {
return
GenericValue
(P); }
51
inline
void
*
GVTOP
(
const
GenericValue
&GV) {
return
GV.
PointerVal
; }
52
53
}
// End llvm namespace.
54
#endif
llvm::GenericValue::PointerVal
PointerTy PointerVal
Definition:
GenericValue.h:35
llvm::GenericValue::AggregateVal
std::vector< GenericValue > AggregateVal
Definition:
GenericValue.h:41
llvm::GenericValue::Untyped
unsigned char Untyped[8]
Definition:
GenericValue.h:37
llvm::GenericValue::IntPair
Definition:
GenericValue.h:28
APInt.h
This file implements a class to represent arbitrary precision integral constant values and operations...
llvm::GenericValue
Definition:
GenericValue.h:27
llvm::GenericValue::DoubleVal
double DoubleVal
Definition:
GenericValue.h:33
P
#define P(N)
llvm::GenericValue::GenericValue
GenericValue(void *V)
Definition:
GenericValue.h:47
llvm::GenericValue::IntPair::first
unsigned int first
Definition:
GenericValue.h:29
llvm::GenericValue::FloatVal
float FloatVal
Definition:
GenericValue.h:34
llvm::GenericValue::UIntPairVal
struct IntPair UIntPairVal
Definition:
GenericValue.h:36
llvm::GVTOP
void * GVTOP(const GenericValue &GV)
Definition:
GenericValue.h:51
llvm::PTOGV
GenericValue PTOGV(void *P)
Definition:
GenericValue.h:50
llvm::APInt
Class for arbitrary precision integers.
Definition:
APInt.h:77
llvm::GenericValue::GenericValue
GenericValue()
Definition:
GenericValue.h:46
llvm::PointerTy
void * PointerTy
Definition:
GenericValue.h:24
llvm::GenericValue::IntVal
APInt IntVal
Definition:
GenericValue.h:39
llvm::GenericValue::IntPair::second
unsigned int second
Definition:
GenericValue.h:30
Generated on Wed Mar 8 2017 17:08:56 for LLVM by
1.8.6