IRBindings.h raw

   1  //go:build !purego
   2  
   3  //===- IRBindings.h - Additional bindings for IR ----------------*- C++ -*-===//
   4  //
   5  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
   6  // See https://llvm.org/LICENSE.txt for license information.
   7  // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
   8  //
   9  //===----------------------------------------------------------------------===//
  10  //
  11  // This file defines additional C bindings for the IR component.
  12  //
  13  //===----------------------------------------------------------------------===//
  14  
  15  #ifndef LLVM_BINDINGS_GO_LLVM_IRBINDINGS_H
  16  #define LLVM_BINDINGS_GO_LLVM_IRBINDINGS_H
  17  
  18  #include "llvm-c/Core.h"
  19  #include "llvm-c/DebugInfo.h"
  20  #ifdef __cplusplus
  21  #include "llvm/IR/Metadata.h"
  22  #include "llvm/Support/CBindingWrapping.h"
  23  #endif
  24  
  25  #include <stdint.h>
  26  
  27  #ifdef __cplusplus
  28  extern "C" {
  29  #endif
  30  
  31  struct LLVMDebugLocMetadata{
  32      unsigned Line;
  33      unsigned Col;
  34      LLVMMetadataRef Scope;
  35      LLVMMetadataRef InlinedAt;
  36  };
  37  
  38  LLVMMetadataRef LLVMConstantAsMetadata(LLVMValueRef Val);
  39  
  40  LLVMMetadataRef LLVMMDString2(LLVMContextRef C, const char *Str, unsigned SLen);
  41  LLVMMetadataRef LLVMMDNode2(LLVMContextRef C, LLVMMetadataRef *MDs,
  42                              unsigned Count);
  43  
  44  void LLVMAddNamedMetadataOperand2(LLVMModuleRef M, const char *name,
  45                                    LLVMMetadataRef Val);
  46  void LLVMSetMetadata2(LLVMValueRef Inst, unsigned KindID, LLVMMetadataRef MD);
  47  
  48  void LLVMGoSetCurrentDebugLocation(LLVMBuilderRef Bref, unsigned Line,
  49                                    unsigned Col, LLVMMetadataRef Scope,
  50                                    LLVMMetadataRef InlinedAt);
  51  
  52  struct LLVMDebugLocMetadata LLVMGoGetCurrentDebugLocation(LLVMBuilderRef Bref);
  53  
  54  LLVMValueRef LLVMGoGetInlineAsm(LLVMTypeRef Ty, char *AsmString,
  55                                  size_t AsmStringSize, char *Constraints,
  56                                  size_t ConstraintsSize, LLVMBool HasSideEffects,
  57                                  LLVMBool IsAlignStack,
  58                                  LLVMInlineAsmDialect Dialect, LLVMBool CanThrow);
  59  
  60  #ifdef __cplusplus
  61  }
  62  #endif
  63  
  64  #endif
  65