[llvm-dev] Is it possible to generate the IR representation with the original macro information?

Peng Yu via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 18 14:43:16 PST 2019


Hi,

I use the following commands to compile the IR. But I don't see the
macro information in the .ll file. Is there a way to preserve the
macro information (print() in this case) for debugging purposes?

$ clang -std=gnu99 -g3 -flto -Wall -pedantic -c -o main.o main.c
$ clang main.o -flto -fuse-ld=gold '-Wl,-plugin-opt=save-temps' -o main.exe
$ llvm-dis main.exe.0.0.preopt.bc

/* vim: set noexpandtab tabstop=2: */
#include <stdio.h>

#define print() puts("Hello World!");

int main() {
    print();
    return 0;
}

-- 
Regards,
Peng


More information about the llvm-dev mailing list