首页 > 解决方案 > How to emit debug information using llvm ir in Clang?

问题描述

Using clang or clang++ the command of clang -S -emit-llvm ./source.c will create a llvm ir document. However debugging information is missing. So when you test and compile things you lose debugging information.

How does one can make clang emit human readable llvm ir document with debug information ?

标签: cclangllvmclang++llvm-ir

解决方案


添加调试信息的标准选项是-g. 所以,运行clang -g -S -emit-llvm source.c会发出必要的信息


推荐阅读