Skip to content

Commit 971bc83

Browse files
committed
l2s: process annotations first
1 parent 08d4c44 commit 971bc83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/frontends/llvm/l2s.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ const Node* convert_global(Parser* p, LLVMValueRef global) {
198198
String intrinsic = is_llvm_intrinsic(global);
199199
if (intrinsic) {
200200
if (strcmp(intrinsic, "llvm.global.annotations") == 0) {
201-
process_llvm_annotations(p, global);
202201
return NULL;
203202
}
204203
warn_print("Skipping unknown LLVM intrinsic function: %s\n", name);
@@ -258,6 +257,10 @@ bool parse_llvm_into_shady(Module* dst, size_t len, const char* data) {
258257
.dst = dirty,
259258
};
260259

260+
LLVMValueRef global_annotations = LLVMGetNamedGlobal(src, "llvm.global.annotations");
261+
if (global_annotations)
262+
process_llvm_annotations(&p, global_annotations);
263+
261264
for (LLVMValueRef fn = LLVMGetFirstFunction(src); fn && fn <= LLVMGetNextFunction(fn); fn = LLVMGetLastFunction(src)) {
262265
convert_function(&p, fn);
263266
}

0 commit comments

Comments
 (0)