Neutrino
Neutrino

Reputation: 35

How to get metadata without -g

I'm trying to write a LLVM function pass to do some instrumentation. Therefore, I I need to get

  1. filename in which the function is declared
  2. the line numbers (begin and end) of the source file in which the function is decalred.

I already found and tried getMetadata("dbg") but I do not want to use the compiler flag -g. Is there another way to get these information?

Upvotes: 0

Views: 83

Answers (1)

Anton Korobeynikov
Anton Korobeynikov

Reputation: 9324

Well... the debug metadata is emitted when debug info generation is enabled. You may want to reduce the amount of debug information generated with -gline-tables-only

Upvotes: 1

Related Questions