Clang as back-end

Hello,

I am interesting in doing dynamic information flow tracking - DIFT. In the process, I need to add a new attribute for each variable used in the program, and also I need to modify the way how the variables are aggregate (on BBS | heap | stack of an x86 architecture). My concern is if Clang could be the tool that I need.

From the “get started” guide, I see that (1) clang is the front-end. (2) LLVM is used to optimize the IR, but I didn’t see what is the back-end. Is clang also the back-end? or this option is open?

BTW. Where I can more details about “addspace” instruction. I found some piece of information in several documents (LLVM and Clang) but I didn’t see any document or section that talk about it. And the last question: is “addrspace” instruction just for global variables?

Thanks in advance,

I am interesting in doing dynamic information flow tracking - DIFT. In the process, I need to add a new attribute for each variable used in the program, and also I need to modify the way how the variables are aggregate (on BBS | heap | stack of an x86 architecture). My concern is if Clang could be the tool that I need.

From the "get started" guide, I see that (1) clang is the front-end. (2) LLVM is used to optimize the IR, but I didn't see what is the back-end. Is clang also the back-end? or this option is open?

Clang is the front end. It has a "CodeGen" module that lowers to the LLVM optimizer and back-end. Clang's abstract syntax trees should be generic enough that one could generate IR for a different back-end, but to my knowledge nobody has tried that.

BTW. Where I can more details about "addspace" instruction. I found some piece of information in several documents (LLVM and Clang) but I didn't see any document or section that talk about it. And the last question: is "addrspace" instruction just for global variables?

It's not an instruction, but a qualifier that specifies which address space something resides in. It can be applied to globals and the types referenced by pointers. The intent is to model the named address spaces of the C Embedded TR (http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1169.pdf); the specific syntax we've chosen is shown here:

  http://clang.llvm.org/docs/LanguageExtensions.html#x86-specific

  - Doug

Hello,

I tried to test the qualifier address_space so I used the example in the web site: http://clang.llvm.org/docs/LanguageExtensions.html#x86-specific

I used <clang-cc + llvm-as + llc>, and I got the expected result; however, when I tried to generated the executable, I got the bellow error.

Any idea that what can be wrong.

Thanks in advance,

Juan Carlos

Hi,