Unfortunately, no<br><br><div class="gmail_quote"><div dir="ltr">On Sat, Jan 19, 2019, 12:58 PM Peng Yu <<a href="mailto:pengyu.ut@gmail.com">pengyu.ut@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So there is no way to associate macro to IR code? Thanks.<br>
<br>
On Sat, Jan 19, 2019 at 2:23 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
><br>
> -g -fdebug-macro will include macro info in the debug info in the IR. It doesn't track which bits of IR were expanded from macros (anymore than the source locations do without -fdebug-macro) - just provides the macro text so, for instance, debugger users can use the macros in expresions.<br>
><br>
> On Fri, Jan 18, 2019 at 2:43 PM Peng Yu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I use the following commands to compile the IR. But I don't see the<br>
>> macro information in the .ll file. Is there a way to preserve the<br>
>> macro information (print() in this case) for debugging purposes?<br>
>><br>
>> $ clang -std=gnu99 -g3 -flto -Wall -pedantic -c -o main.o main.c<br>
>> $ clang main.o -flto -fuse-ld=gold '-Wl,-plugin-opt=save-temps' -o main.exe<br>
>> $ llvm-dis main.exe.0.0.preopt.bc<br>
>><br>
>> /* vim: set noexpandtab tabstop=2: */<br>
>> #include <stdio.h><br>
>><br>
>> #define print() puts("Hello World!");<br>
>><br>
>> int main() {<br>
>>     print();<br>
>>     return 0;<br>
>> }<br>
>><br>
>> --<br>
>> Regards,<br>
>> Peng<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
<br>
<br>
-- <br>
Regards,<br>
Peng<br>
</blockquote></div>