llvm/polly/lib/Support/GICHelper.cpp

//===- GmpConv.cpp - Recreate LLVM IR from the Scop.  ---------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Functions for converting between gmp objects and llvm::APInt.
//
//===----------------------------------------------------------------------===//

#include "polly/Support/GICHelper.h"
#include "llvm/ADT/APInt.h"
#include "isl/val.h"

usingnamespacellvm;

__isl_give isl_val *polly::isl_valFromAPInt(isl_ctx *Ctx, const APInt Int,
                                            bool IsSigned) {}

APInt polly::APIntFromVal(__isl_take isl_val *Val) {}

template <typename ISLTy, typename ISL_CTX_GETTER, typename ISL_PRINTER>
static inline std::string
stringFromIslObjInternal(__isl_keep ISLTy *isl_obj,
                         ISL_CTX_GETTER ctx_getter_fn, ISL_PRINTER printer_fn,
                         const std::string &DefaultValue) {}

#define ISL_C_OBJECT_TO_STRING(name)

ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()
ISL_C_OBJECT_TO_STRING()

static void replace(std::string &str, StringRef find, StringRef replace) {}

static void makeIslCompatible(std::string &str) {}

std::string polly::getIslCompatibleName(const std::string &Prefix,
                                        const std::string &Middle,
                                        const std::string &Suffix) {}

std::string polly::getIslCompatibleName(const std::string &Prefix,
                                        const std::string &Name, long Number,
                                        const std::string &Suffix,
                                        bool UseInstructionNames) {}

std::string polly::getIslCompatibleName(const std::string &Prefix,
                                        const Value *Val, long Number,
                                        const std::string &Suffix,
                                        bool UseInstructionNames) {}

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
#define ISL_DUMP_OBJECT_IMPL

ISL_DUMP_OBJECT_IMPL(aff)
ISL_DUMP_OBJECT_IMPL(aff_list)
ISL_DUMP_OBJECT_IMPL(ast_expr)
ISL_DUMP_OBJECT_IMPL(ast_node)
ISL_DUMP_OBJECT_IMPL(ast_node_list)
ISL_DUMP_OBJECT_IMPL(basic_map)
ISL_DUMP_OBJECT_IMPL(basic_map_list)
ISL_DUMP_OBJECT_IMPL(basic_set)
ISL_DUMP_OBJECT_IMPL(basic_set_list)
ISL_DUMP_OBJECT_IMPL(constraint)
ISL_DUMP_OBJECT_IMPL(id)
ISL_DUMP_OBJECT_IMPL(id_list)
ISL_DUMP_OBJECT_IMPL(id_to_ast_expr)
ISL_DUMP_OBJECT_IMPL(local_space)
ISL_DUMP_OBJECT_IMPL(map)
ISL_DUMP_OBJECT_IMPL(map_list)
ISL_DUMP_OBJECT_IMPL(multi_aff)
ISL_DUMP_OBJECT_IMPL(multi_pw_aff)
ISL_DUMP_OBJECT_IMPL(multi_union_pw_aff)
ISL_DUMP_OBJECT_IMPL(multi_val)
ISL_DUMP_OBJECT_IMPL(point)
ISL_DUMP_OBJECT_IMPL(pw_aff)
ISL_DUMP_OBJECT_IMPL(pw_aff_list)
ISL_DUMP_OBJECT_IMPL(pw_multi_aff)
ISL_DUMP_OBJECT_IMPL(schedule)
ISL_DUMP_OBJECT_IMPL(schedule_constraints)
ISL_DUMP_OBJECT_IMPL(schedule_node)
ISL_DUMP_OBJECT_IMPL(set)
ISL_DUMP_OBJECT_IMPL(set_list)
ISL_DUMP_OBJECT_IMPL(space)
ISL_DUMP_OBJECT_IMPL(union_map)
ISL_DUMP_OBJECT_IMPL(union_pw_aff)
ISL_DUMP_OBJECT_IMPL(union_pw_aff_list)
ISL_DUMP_OBJECT_IMPL(union_pw_multi_aff)
ISL_DUMP_OBJECT_IMPL(union_set)
ISL_DUMP_OBJECT_IMPL(union_set_list)
ISL_DUMP_OBJECT_IMPL(val)
ISL_DUMP_OBJECT_IMPL(val_list)

void polly::dumpIslObj(__isl_keep isl_schedule_node *node, raw_ostream &OS) {
  if (!node)
    return;

  isl_ctx *ctx = isl_schedule_node_get_ctx(node);
  isl_printer *p = isl_printer_to_str(ctx);
  p = isl_printer_set_yaml_style(p, ISL_YAML_STYLE_BLOCK);
  p = isl_printer_print_schedule_node(p, node);

  char *char_str = isl_printer_get_str(p);
  OS << char_str;

  free(char_str);
  isl_printer_free(p);
}

void polly::dumpIslObj(const isl::schedule_node &Node, raw_ostream &OS) {
  dumpIslObj(Node.get(), OS);
}

#endif