aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/DIBuilder.cpp')
-rw-r--r--lib/IR/DIBuilder.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index af055c9f2f..2fe13c44c6 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -924,7 +924,8 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this mdnode.
- AllSubprograms.push_back(Node);
+ if (isDefinition)
+ AllSubprograms.push_back(Node);
return DISubprogram(Node);
}
@@ -968,6 +969,8 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)
};
MDNode *Node = MDNode::get(VMContext, Elts);
+ if (isDefinition)
+ AllSubprograms.push_back(Node);
return DISubprogram(Node);
}