[llvm] r229573 - IR: fieldIsMDNode() should be false for MDString

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Feb 17 14:34:15 PST 2015


Author: dexonsmith
Date: Tue Feb 17 16:34:15 2015
New Revision: 229573

URL: http://llvm.org/viewvc/llvm-project?rev=229573&view=rev
Log:
IR: fieldIsMDNode() should be false for MDString

Simplify the code.  It has been a while since the schema has been so
"flexible".

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

Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=229573&r1=229572&r2=229573&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Tue Feb 17 16:34:15 2015
@@ -385,16 +385,9 @@ bool DIObjCProperty::Verify() const {
 }
 
 /// \brief Check if a field at position Elt of a MDNode is a MDNode.
-///
-/// We currently allow an empty string and an integer.
-/// But we don't allow a non-empty string in a MDNode field.
 static bool fieldIsMDNode(const MDNode *DbgNode, unsigned Elt) {
-  // FIXME: This function should return true, if the field is null or the field
-  // is indeed a MDNode: return !Fld || isa<MDNode>(Fld).
   Metadata *Fld = getField(DbgNode, Elt);
-  if (Fld && isa<MDString>(Fld) && !cast<MDString>(Fld)->getString().empty())
-    return false;
-  return true;
+  return !Fld || isa<MDNode>(Fld);
 }
 
 /// \brief Check if a field at position Elt of a MDNode is a MDString.





More information about the llvm-commits mailing list