DEBUG macro not working in Clang

Hi All,

I wasn’t able to get the DEBUG macro defined in llvm/lib/Support/Debug.[h|cpp] and documented in LLVM Programmer’s Manual
to work with Clang, either through driver or through the frontend:

clang -cc1 -debug

dies with “no such option”,

and

clang —debug

runs, but the option is ignored.

According to the documentation, using -debug should activate the code inside DEBUG macros, and additionally allow users
to activate them selectively using -debug-only flag.

It definitely did work at some point in the past,
so the change seems like a regression.
Was it removed on purpose?

Thanks,
George

You want "clang -mllvm -debug".

-Eli

Hi All,

I wasn’t able to get the DEBUG macro defined in llvm/lib/Support/Debug.[h|cpp] and documented in LLVM Programmer’s Manual
to work with Clang, either through driver or through the frontend:

clang -cc1 -debug

dies with “no such option”,

and

clang —debug

runs, but the option is ignored.

You want "clang -mllvm -debug”.

Thanks, that’s great to know!