Skip to content

How to use MIR_new_mem_op? #317

Answered by vnmakarov
giann asked this question in Q&A
Feb 17, 2023 · 6 comments · 3 replies
Discussion options

You must be logged in to vote

It seems you missed call MIR_link that is where MIR simplification is done besides linking loaded modules. You should call MIR_link even for one module. The code on C should look like:

#include "mir-gen.h"
typedef unsigned long u64;
struct Test {
  u64 a, *b;
  int c;
};
int main (void) {
  MIR_context_t ctx = MIR_init ();
  MIR_scan_string (ctx,
                   "test_m: module\n\                                                                                                                                                                                                                         
         export test\n\                                                                      …

Replies: 6 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@giann
Comment options

@vnmakarov
Comment options

Comment options

You must be logged in to vote
1 reply
@giann
Comment options

Answer selected by giann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants