[llvm] r208909 - DebugInfo: Add FIXME regarding DILexicalBlock uniquing fields.

David Blaikie dblaikie at gmail.com
Thu May 15 13:09:56 PDT 2014


Author: dblaikie
Date: Thu May 15 15:09:55 2014
New Revision: 208909

URL: http://llvm.org/viewvc/llvm-project?rev=208909&view=rev
Log:
DebugInfo: Add FIXME regarding DILexicalBlock uniquing fields.

Modified:
    llvm/trunk/lib/IR/DIBuilder.cpp

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=208909&r1=208908&r2=208909&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Thu May 15 15:09:55 2014
@@ -1226,6 +1226,13 @@ DILexicalBlockFile DIBuilder::createLexi
 DILexicalBlock DIBuilder::createLexicalBlock(DIDescriptor Scope, DIFile File,
                                              unsigned Line, unsigned Col,
                                              unsigned Discriminator) {
+  // FIXME: This isn't thread safe nor the right way to defeat MDNode uniquing.
+  // I believe the right way is to have a self-referential element in the node.
+  // Also: why do we bother with line/column - they're not used and the
+  // documentation (SourceLevelDebugging.rst) claims the line/col are necessary
+  // for uniquing, yet then we have this other solution (because line/col were
+  // inadequate) anyway. Remove all 3 and replace them with a self-reference.
+
   // Defeat MDNode uniquing for lexical blocks by using unique id.
   static unsigned int unique_id = 0;
   Value *Elts[] = {





More information about the llvm-commits mailing list