ldc/runtime/jit-rt/cpp-so/valueparser.h
2018-10-20 16:19:46 +02:00

33 lines
1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//===-- valueparser.h - jit support -----------------------------*- C++ -*-===//
//
// LDC the LLVM D compiler
//
// This file is distributed under the Boost Software License. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===//
//
// Jit runtime - value parser.
// Reads data from host process and generates llvm::Constant suitable
// as initializer.
//
//===----------------------------------------------------------------------===//
#pragma once
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
namespace llvm {
class Constant;
class Type;
class DataLayout;
}
using ParseInitializerOverride = llvm::Optional<
llvm::function_ref<llvm::Constant *(llvm::Type &, const void *, size_t)>>;
llvm::Constant *parseInitializer(
const llvm::DataLayout &dataLayout, llvm::Type &type, const void *data,
llvm::function_ref<void(const std::string &)> errHandler,
const ParseInitializerOverride &override = ParseInitializerOverride{});