33#ifndef LLVM_CLANG_INTERPRETER_VALUE_H
34#define LLVM_CLANG_INTERPRETER_VALUE_H
36#include "llvm/Config/llvm-config.h"
37#include "llvm/Support/Compiler.h"
66#define REPL_EXTERNAL_VISIBILITY __declspec(dllexport)
67#elif __has_attribute(visibility)
68#if defined(LLVM_BUILD_LLVM_DYLIB) || defined(LLVM_BUILD_SHARED_LIBS)
69#define REPL_EXTERNAL_VISIBILITY __attribute__((visibility("default")))
71#define REPL_EXTERNAL_VISIBILITY
74#define REPL_EXTERNAL_VISIBILITY
77#define REPL_BUILTIN_TYPES \
80 X(signed char, SChar) \
81 X(unsigned char, Char_U) \
82 X(unsigned char, UChar) \
84 X(unsigned short, UShort) \
86 X(unsigned int, UInt) \
88 X(unsigned long, ULong) \
89 X(long long, LongLong) \
90 X(unsigned long long, ULongLong) \
93 X(long double, LongDouble)
97#define X(type, name) type m_##name;
101 unsigned char m_RawBits[
sizeof(
long double)];
106#define X(type, name) K_##name,
123 void printType(llvm::raw_ostream &Out)
const;
124 void printData(llvm::raw_ostream &Out)
const;
125 void print(llvm::raw_ostream &Out)
const;
141 void *getPtr()
const;
146 void setRawBits(
void *Ptr,
unsigned NBytes =
sizeof(Storage));
148#define X(type, name) \
149 void set##name(type Val) { Data.m_##name = Val; } \
150 type get##name() const { return Data.m_##name; }
168 template <
typename T> T
as()
const {
172#define X(type, name) \
173 case Value::K_##name: \
174 return (T)Data.m_##name;
183 if (
V.isPointerOrObjectType())
185 if (!
V.isValid() ||
V.isVoid()) {
194 if (
V.isPointerOrObjectType())
207template <>
inline void *Value::as()
const {
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
static void print(llvm::raw_ostream &OS, const T &V, const Context &Ctx, QualType Ty)
#define REPL_EXTERNAL_VISIBILITY
#define REPL_BUILTIN_TYPES
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Provides top-level interfaces for incremental compilation and execution.
A (possibly-)qualified type.
const Interpreter & getInterpreter() const
bool isManuallyAlloc() const
void printType(llvm::raw_ostream &Out) const
bool isPointerOrObjectType() const
REPL_BUILTIN_TYPES T convertTo() const
Get the value with cast.
T as() const
Get to the value with type checking casting the underlying stored value to T.
Value & operator=(const Value &RHS)
void printData(llvm::raw_ostream &Out) const
void setOpaqueType(void *Ty)
const ASTContext & getASTContext() const
const Interpreter * Interp
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
static T * cast(const Value &V)
static T cast(const Value &V)