[PATCH] DebugIR with no existing debug information

Langmuir, Ben ben.langmuir at intel.com
Mon Jun 24 06:29:31 PDT 2013


Sending again, since the llvm-commits address was incorrect.  Sorry for the duplicate email.

Hi Dan,

Overall looks good to me.


> diff --git a/include/llvm/Transforms/Instrumentation.h 
> b/include/llvm/Transforms/Instrumentation.h
> +/// Any existing debug metadata is mostly preserved in order to allow 
> +accessing /// variables in the original source.

Tests?


+/// createDebugIRPass - Enable interactive stepping through LLVM IR in LLDB
+///                     (or GDB). When creating a DebugIR pass with this
+///                     function, no source file is output to disk. If the IR
+///                     file to be debugged is not on disk, use the version of
+///                     this function with parameters in order to generate the
+///                     file that will be seen by the debugger.
+ModulePass *createDebugIRPass();

So I would use this function if my IR file is already on disk, and this implies that the IR file is modified in-place.  Whereas, if I was running this pass from Clang, I would want to use the version with parameters, right?  If so we should be explicit about the fact on-disk IR files will be modified in-place.


> diff --git a/lib/Transforms/Instrumentation/DebugIR.cpp 
> b/lib/Transforms/Instrumentation/DebugIR.cpp
> +// FIXME: instead of replacing debug metadata, this pass should allow 
> +for // additional metadata should be used to point capable debuggers 
> +to the IR file // without destroying the mapping to the original source file.

In the second line, s/should/to/


> #include <string>
>  
> +#include <unistd.h>
> +
>  #include "llvm/ADT/OwningPtr.h" 

LLVM coding standards prefer system headers after llvm/.. headers.

Ben




More information about the llvm-commits mailing list