2

I need to add to gcc support of an OpenMP-like (directive) language. I know it is possible to dump GIMPLE code and then "undump" it and continue compilation. I want to modify the dumped DIMPLE to add calls of my dynamic library, modify variables, and so on. Is there any handy tool to do this?

EDIT: Perhaps LLVM is what I need. Currently I am interested in how to transform GIMPLE to LLVM IR. Also, is there a way to get information what line of source code corresponds to concrete operator of IR?

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
Vlad Krylov
  • 2,684
  • 3
  • 21
  • 23

2 Answers2

2

Depends on what you exactly need, you might be able to do this using GCC Plugins.

Amir Gonnen
  • 3,525
  • 4
  • 32
  • 61
  • thanks Amir, but it seems that only MELT fits my needs and i have reasons not to use it: 1. lisp isn't good for me 2. it's unripe – Vlad Krylov Mar 01 '11 at 16:23
  • 1
    MELT is an existing GCC plugin. But instead, you could consider developing your own GCC plugin to suit your needs. – Amir Gonnen Mar 01 '11 at 17:04
1

GIMPLE => LLVM IR translator is called "llvm-gcc" (or DragonEgg if you want a GCC plugin). The standard way of storing the map between lines of source language and something in LLVM IR is via emission of the debug information.

Anton Korobeynikov
  • 9,074
  • 25
  • 28