xref: /netbsd-src/external/apache2/llvm/dist/llvm/bindings/go/llvm/IRBindings.h (revision 7330f729ccf0bd976a06f95fad452fe774fc7fd1)
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 #ifdef __cplusplus
53 }
54 
55 #endif
56 
57 #endif
58