[PATCH] D29852: Expose getBaseDiscriminatorFromDiscriminator, getDuplicationFactorFromDiscriminator and getCopyIdentifierFromDiscriminator API so that downstream tools can use them to get the correct encoding.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 08:58:00 PST 2017


davidxl added inline comments.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:1257
 
+  /// With a give unsigned int \p U, use up to 13 bits to represent it.
+  /// old_bit 1~5  --> new_bit 1~5
----------------
give -> given


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:1404
 
+  static unsigned getBaseDiscriminatorFromDiscriminator(unsigned D) {
+    if ((D & 1) == 0)
----------------
Add documentation comment.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:1411
+
+  static unsigned getDuplicationFactorFromDiscriminator(unsigned D) {
+    D = getNextComponentInDiscriminator(D);
----------------
same here.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:1419
+
+  static unsigned getCopyIdentifierFromDiscriminator(unsigned D) {
+    return getUnsignedFromPrefixEncoding(getNextComponentInDiscriminator(
----------------
Same here.


https://reviews.llvm.org/D29852





More information about the llvm-commits mailing list