[LLVMdev] Questions about how to debug LLVM and CLang

Krzysztof Parzyszek kparzysz at codeaurora.org
Thu Apr 10 09:35:30 PDT 2014


On 4/9/2014 9:11 PM, 蜡笔小新 wrote:
>
> What's more, the code of LLVM and Clang is so huge that it is hard for
> me to get started. If I want to make some modifications or just wanna to
> debug the source code, what should I do?

Depends on what you want to do exactly.  For LLVM, using 
-print-after-all will show you the IR after each pass, which can give 
you an idea of what passes are run and what each pass does.  Debugging 
an individual pass is also fairly straightforward, since the code is 
usually contained within a single source file.
I never use debuggers to debug the compiler itself---I just put a bunch 
of "dbgs() << ..." in the code to see what I want to see.

-Krzysztof

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list