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