llvm/llvm/lib/Target/TargetMachineC.cpp

//===-- TargetMachine.cpp -------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file implements the LLVM-C part of TargetMachine.h
//
//===----------------------------------------------------------------------===//

#include "llvm-c/Core.h"
#include "llvm-c/TargetMachine.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/CodeGenCWrappers.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include <cstring>
#include <optional>

usingnamespacellvm;

namespace llvm {

/// Options for LLVMCreateTargetMachine().
struct LLVMTargetMachineOptions {};

} // namespace llvm

DEFINE_SIMPLE_CONVERSION_FUNCTIONS()

static TargetMachine *unwrap(LLVMTargetMachineRef P) {}
static Target *unwrap(LLVMTargetRef P) {}
static LLVMTargetMachineRef wrap(const TargetMachine *P) {}
static LLVMTargetRef wrap(const Target * P) {}

LLVMTargetRef LLVMGetFirstTarget() {}
LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T) {}

LLVMTargetRef LLVMGetTargetFromName(const char *Name) {}

LLVMBool LLVMGetTargetFromTriple(const char* TripleStr, LLVMTargetRef *T,
                                 char **ErrorMessage) {}

const char * LLVMGetTargetName(LLVMTargetRef T) {}

const char * LLVMGetTargetDescription(LLVMTargetRef T) {}

LLVMBool LLVMTargetHasJIT(LLVMTargetRef T) {}

LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T) {}

LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T) {}

LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions(void) {}

void LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options) {}

void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options,
                                    const char *CPU) {}

void LLVMTargetMachineOptionsSetFeatures(LLVMTargetMachineOptionsRef Options,
                                         const char *Features) {}

void LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options,
                                    const char *ABI) {}

void LLVMTargetMachineOptionsSetCodeGenOptLevel(
    LLVMTargetMachineOptionsRef Options, LLVMCodeGenOptLevel Level) {}

void LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options,
                                          LLVMRelocMode Reloc) {}

void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options,
                                          LLVMCodeModel CodeModel) {}

LLVMTargetMachineRef
LLVMCreateTargetMachineWithOptions(LLVMTargetRef T, const char *Triple,
                                   LLVMTargetMachineOptionsRef Options) {}

LLVMTargetMachineRef
LLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple, const char *CPU,
                        const char *Features, LLVMCodeGenOptLevel Level,
                        LLVMRelocMode Reloc, LLVMCodeModel CodeModel) {}

void LLVMDisposeTargetMachine(LLVMTargetMachineRef T) {}

LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T) {}

char* LLVMGetTargetMachineTriple(LLVMTargetMachineRef T) {}

char* LLVMGetTargetMachineCPU(LLVMTargetMachineRef T) {}

char* LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T) {}

void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
                                      LLVMBool VerboseAsm) {}

void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable) {}

void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable) {}

void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T,
                                         LLVMGlobalISelAbortMode Mode) {}

void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T,
                                         LLVMBool Enable) {}

LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T) {}

static LLVMBool LLVMTargetMachineEmit(LLVMTargetMachineRef T, LLVMModuleRef M,
                                      raw_pwrite_stream &OS,
                                      LLVMCodeGenFileType codegen,
                                      char **ErrorMessage) {}

LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M,
                                     const char *Filename,
                                     LLVMCodeGenFileType codegen,
                                     char **ErrorMessage) {}

LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T,
  LLVMModuleRef M, LLVMCodeGenFileType codegen, char** ErrorMessage,
  LLVMMemoryBufferRef *OutMemBuf) {}

char *LLVMGetDefaultTargetTriple(void) {}

char *LLVMNormalizeTargetTriple(const char* triple) {}

char *LLVMGetHostCPUName(void) {}

char *LLVMGetHostCPUFeatures(void) {}

void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM) {}