[PATCH] D49053: [WIP][Docs] Debugging optimized code with debugify

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 11:56:30 PDT 2018


vsk added a comment.

This is looking really nice already! Some more suggestions inline --



================
Comment at: docs/SourceLevelDebugging.rst:1499
+	store i32 10, i32* %0, align 4
+	ret void
+   }
----------------
It looks like this is under-indented by 3 spaces?


================
Comment at: docs/SourceLevelDebugging.rst:1514
+	store i32 10, i32* %0, align 4, !dbg !15
+	ret void, !dbg !16
+   }
----------------
Ditto, it looks like the line containing the 'alloca' is over-indented, and some of the other lines are under-indented by 3 spaces.


================
Comment at: docs/SourceLevelDebugging.rst:1546
+
+Errors/warnings can range from Instructions with empty Debug Location to
+instructions with different type that their corresponding debug value intrinsic,
----------------
'Instructions', 'Debug', and 'Location' don't need to be capitalized here. 


================
Comment at: docs/SourceLevelDebugging.rst:1547
+Errors/warnings can range from Instructions with empty Debug Location to
+instructions with different type that their corresponding debug value intrinsic,
+all the way to missing lines and missing debug value intrinsics.
----------------
Maybe better worded as: "to an instruction having a type that's incompatible with the source variable it describes" 


================
Comment at: docs/SourceLevelDebugging.rst:1553
+
+In the above error, there is a phi instruction (possibly emitted by the transformation)
+without debug location. A way to locate the culprit code and fix it
----------------
The 'Fixing errors' section should be at a higher level. Please describe which APIs you'd use to fix each issue and why. You don't need to include code examples of how these APIs are used: assume that a developer reading this can find the relevant documentation and examples. Also, assume that readers will be able to locate problematic areas in the code.

Missing debug location => Instruction::setDebugLoc, or possibly IRBuilder::setCurrentDebugLocation when using a Builder and the new location should be reused
Debug value with incompatible type => llvm::replaceAllDbgUsesWith (explain why the incompatible type error can occur after a RAUW, and how this utility prevents it)
Missing debug value => llvm::salvageDebugInfo (when no replacement exists), or llvm::replaceAllDbgUsesWith (when a replacement exists)



================
Comment at: docs/SourceLevelDebugging.rst:1585
+
+   # same as the above example
+   $ opt -enable-debugify -pass-to-test sample.ll
----------------
Please always capitalize sentences and end them with periods.


Repository:
  rL LLVM

https://reviews.llvm.org/D49053





More information about the llvm-commits mailing list