<div dir="ltr">-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.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 18, 2019 at 2:43 PM Peng Yu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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>
</blockquote></div>