13
13
#ifndef LLVM_ASMPARSER_PARSER_H
14
14
#define LLVM_ASMPARSER_PARSER_H
15
15
16
+ #include " llvm/Support/Compiler.h"
16
17
#include " llvm/ADT/STLFunctionalExtras.h"
17
18
#include " llvm/ADT/StringRef.h"
18
19
#include < memory>
@@ -44,7 +45,7 @@ typedef llvm::function_ref<std::optional<std::string>(StringRef, StringRef)>
44
45
// / \param Context Context in which to allocate globals info.
45
46
// / \param Slots The optional slot mapping that will be initialized during
46
47
// / parsing.
47
- std::unique_ptr<Module> parseAssemblyFile (StringRef Filename, SMDiagnostic &Err,
48
+ LLVM_ABI std::unique_ptr<Module> parseAssemblyFile (StringRef Filename, SMDiagnostic &Err,
48
49
LLVMContext &Context,
49
50
SlotMapping *Slots = nullptr );
50
51
@@ -59,7 +60,7 @@ std::unique_ptr<Module> parseAssemblyFile(StringRef Filename, SMDiagnostic &Err,
59
60
// / \param Context Context in which to allocate globals info.
60
61
// / \param Slots The optional slot mapping that will be initialized during
61
62
// / parsing.
62
- std::unique_ptr<Module> parseAssemblyString (StringRef AsmString,
63
+ LLVM_ABI std::unique_ptr<Module> parseAssemblyString (StringRef AsmString,
63
64
SMDiagnostic &Err,
64
65
LLVMContext &Context,
65
66
SlotMapping *Slots = nullptr );
@@ -84,15 +85,15 @@ struct ParsedModuleAndIndex {
84
85
// / \param Slots The optional slot mapping that will be initialized during
85
86
// / parsing.
86
87
// / \param DataLayoutCallback Override datalayout in the llvm assembly.
87
- ParsedModuleAndIndex parseAssemblyFileWithIndex (
88
+ LLVM_ABI ParsedModuleAndIndex parseAssemblyFileWithIndex (
88
89
StringRef Filename, SMDiagnostic &Err, LLVMContext &Context,
89
90
SlotMapping *Slots = nullptr ,
90
91
DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) {
91
92
return std::nullopt;
92
93
});
93
94
94
95
// / Only for use in llvm-as for testing; this does not produce a valid module.
95
- ParsedModuleAndIndex parseAssemblyFileWithIndexNoUpgradeDebugInfo (
96
+ LLVM_ABI ParsedModuleAndIndex parseAssemblyFileWithIndexNoUpgradeDebugInfo (
96
97
StringRef Filename, SMDiagnostic &Err, LLVMContext &Context,
97
98
SlotMapping *Slots, DataLayoutCallbackTy DataLayoutCallback);
98
99
@@ -104,7 +105,7 @@ ParsedModuleAndIndex parseAssemblyFileWithIndexNoUpgradeDebugInfo(
104
105
// / Parse LLVM Assembly Index from a file
105
106
// / \param Filename The name of the file to parse
106
107
// / \param Err Error result info.
107
- std::unique_ptr<ModuleSummaryIndex>
108
+ LLVM_ABI std::unique_ptr<ModuleSummaryIndex>
108
109
parseSummaryIndexAssemblyFile (StringRef Filename, SMDiagnostic &Err);
109
110
110
111
// / The function is a secondary interface to the LLVM Assembly Parser. It parses
@@ -115,7 +116,7 @@ parseSummaryIndexAssemblyFile(StringRef Filename, SMDiagnostic &Err);
115
116
// / Parse LLVM Assembly from a string
116
117
// / \param AsmString The string containing assembly
117
118
// / \param Err Error result info.
118
- std::unique_ptr<ModuleSummaryIndex>
119
+ LLVM_ABI std::unique_ptr<ModuleSummaryIndex>
119
120
parseSummaryIndexAssemblyString (StringRef AsmString, SMDiagnostic &Err);
120
121
121
122
// / parseAssemblyFile and parseAssemblyString are wrappers around this function.
@@ -125,7 +126,7 @@ parseSummaryIndexAssemblyString(StringRef AsmString, SMDiagnostic &Err);
125
126
// / \param Slots The optional slot mapping that will be initialized during
126
127
// / parsing.
127
128
// / \param DataLayoutCallback Override datalayout in the llvm assembly.
128
- std::unique_ptr<Module> parseAssembly (
129
+ LLVM_ABI std::unique_ptr<Module> parseAssembly (
129
130
MemoryBufferRef F, SMDiagnostic &Err, LLVMContext &Context,
130
131
SlotMapping *Slots = nullptr ,
131
132
DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) {
@@ -140,7 +141,7 @@ std::unique_ptr<Module> parseAssembly(
140
141
// / parsing.
141
142
// /
142
143
// / parseAssemblyFileWithIndex is a wrapper around this function.
143
- ParsedModuleAndIndex parseAssemblyWithIndex (MemoryBufferRef F,
144
+ LLVM_ABI ParsedModuleAndIndex parseAssemblyWithIndex (MemoryBufferRef F,
144
145
SMDiagnostic &Err,
145
146
LLVMContext &Context,
146
147
SlotMapping *Slots = nullptr );
@@ -151,7 +152,7 @@ ParsedModuleAndIndex parseAssemblyWithIndex(MemoryBufferRef F,
151
152
// / \param Err Error result info.
152
153
// /
153
154
// / parseSummaryIndexAssemblyFile is a wrapper around this function.
154
- std::unique_ptr<ModuleSummaryIndex>
155
+ LLVM_ABI std::unique_ptr<ModuleSummaryIndex>
155
156
parseSummaryIndexAssembly (MemoryBufferRef F, SMDiagnostic &Err);
156
157
157
158
// / This function is the low-level interface to the LLVM Assembly Parser.
@@ -167,7 +168,7 @@ parseSummaryIndexAssembly(MemoryBufferRef F, SMDiagnostic &Err);
167
168
// / parsing.
168
169
// / \return true on error.
169
170
// / \param DataLayoutCallback Override datalayout in the llvm assembly.
170
- bool parseAssemblyInto (
171
+ LLVM_ABI bool parseAssemblyInto (
171
172
MemoryBufferRef F, Module *M, ModuleSummaryIndex *Index, SMDiagnostic &Err,
172
173
SlotMapping *Slots = nullptr ,
173
174
DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) {
@@ -182,15 +183,15 @@ bool parseAssemblyInto(
182
183
// / \param Slots The optional slot mapping that will restore the parsing state
183
184
// / of the module.
184
185
// / \return null on error.
185
- Constant *parseConstantValue (StringRef Asm, SMDiagnostic &Err, const Module &M,
186
+ LLVM_ABI Constant *parseConstantValue (StringRef Asm, SMDiagnostic &Err, const Module &M,
186
187
const SlotMapping *Slots = nullptr );
187
188
188
189
// / Parse a type in the given string.
189
190
// /
190
191
// / \param Slots The optional slot mapping that will restore the parsing state
191
192
// / of the module.
192
193
// / \return null on error.
193
- Type *parseType (StringRef Asm, SMDiagnostic &Err, const Module &M,
194
+ LLVM_ABI Type *parseType (StringRef Asm, SMDiagnostic &Err, const Module &M,
194
195
const SlotMapping *Slots = nullptr );
195
196
196
197
// / Parse a string \p Asm that starts with a type.
@@ -200,10 +201,10 @@ Type *parseType(StringRef Asm, SMDiagnostic &Err, const Module &M,
200
201
// / \param Slots The optional slot mapping that will restore the parsing state
201
202
// / of the module.
202
203
// / \return null on error.
203
- Type *parseTypeAtBeginning (StringRef Asm, unsigned &Read, SMDiagnostic &Err,
204
+ LLVM_ABI Type *parseTypeAtBeginning (StringRef Asm, unsigned &Read, SMDiagnostic &Err,
204
205
const Module &M, const SlotMapping *Slots = nullptr );
205
206
206
- DIExpression *parseDIExpressionBodyAtBeginning (StringRef Asm, unsigned &Read,
207
+ LLVM_ABI DIExpression *parseDIExpressionBodyAtBeginning (StringRef Asm, unsigned &Read,
207
208
SMDiagnostic &Err,
208
209
const Module &M,
209
210
const SlotMapping *Slots);
0 commit comments