summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-16 21:21:10 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-16 21:21:10 +0000
commit3d510665e98e12838abf8b949c96191bbe2b3935 (patch)
tree2f51813258ff557df11ba8891ccf8e61f14e928a /llvm/lib/IR/AsmWriter.cpp
parentb786572d7c039e75bd6c285dfec4b3ac0056e1fc (diff)
downloadbcm5719-llvm-3d510665e98e12838abf8b949c96191bbe2b3935.tar.gz
bcm5719-llvm-3d510665e98e12838abf8b949c96191bbe2b3935.zip
AsmWriter: Handle broken metadata nodes
Print out temporary `MDNode`s so we don't crash in the verifier (or during `dump()` output). llvm-svn: 232417
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index ea6822052d0..fb23c7e436a 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1916,10 +1916,10 @@ static void WriteMDNodeBodyInternal(raw_ostream &Out, const MDNode *Node,
TypePrinting *TypePrinter,
SlotTracker *Machine,
const Module *Context) {
- assert(!Node->isTemporary() && "Unexpected forward declaration");
-
if (Node->isDistinct())
Out << "distinct ";
+ else if (Node->isTemporary())
+ Out << "<temporary!> "; // Handle broken code.
switch (Node->getMetadataID()) {
default:
OpenPOWER on IntegriCloud