summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index c363da2f560..6248f3e7c3c 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1827,12 +1827,25 @@ static void writeMDObjCProperty(raw_ostream &Out, const MDObjCProperty *N,
Out << ")";
}
-static void writeMDImportedEntity(raw_ostream &, const MDImportedEntity *,
- TypePrinting *, SlotTracker *,
- const Module *) {
- llvm_unreachable("write not implemented");
+static void writeMDImportedEntity(raw_ostream &Out, const MDImportedEntity *N,
+ TypePrinting *TypePrinter,
+ SlotTracker *Machine, const Module *Context) {
+ Out << "!MDImportedEntity(";
+ FieldSeparator FS;
+ writeTag(Out, FS, N);
+ Out << FS << "scope: ";
+ writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
+ if (N->getEntity()) {
+ Out << FS << "entity: ";
+ writeMetadataAsOperand(Out, N->getEntity(), TypePrinter, Machine, Context);
+ }
+ if (N->getLine())
+ Out << FS << "line: " << N->getLine();
+ Out << FS << "name: \"" << N->getName() << "\"";
+ Out << ")";
}
+
static void WriteMDNodeBodyInternal(raw_ostream &Out, const MDNode *Node,
TypePrinting *TypePrinter,
SlotTracker *Machine,
OpenPOWER on IntegriCloud