From 54d7f09b710329983fc3657fd434c6bfc101227d Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 17 Feb 2015 22:34:15 +0000 Subject: [PATCH] IR: fieldIsMDNode() should be false for MDString Simplify the code. It has been a while since the schema has been so "flexible". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229573 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/DebugInfo.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 76b21d8d09d..9a7ff062de0 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -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(Fld). Metadata *Fld = getField(DbgNode, Elt); - if (Fld && isa(Fld) && !cast(Fld)->getString().empty()) - return false; - return true; + return !Fld || isa(Fld); } /// \brief Check if a field at position Elt of a MDNode is a MDString. -- 2.34.1