summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-03 21:54:14 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-03 21:54:14 +0000
commit4e4aa7053503a00c29fadaec82e2f399bc9da492 (patch)
treed96c4bb1895e44a477fa4131e76d73bbbea3836d /llvm/lib/IR/AsmWriter.cpp
parent37cd4d0f42c31cc0c933069e528e65deaeb94477 (diff)
downloadbcm5719-llvm-4e4aa7053503a00c29fadaec82e2f399bc9da492.tar.gz
bcm5719-llvm-4e4aa7053503a00c29fadaec82e2f399bc9da492.zip
IR: Assembly and bitcode for GenericDebugNode
llvm-svn: 228041
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index d52ac87c983..ba1c5260074 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1286,10 +1286,32 @@ raw_ostream &operator<<(raw_ostream &OS, FieldSeparator &FS) {
}
} // end namespace
-static void writeGenericDebugNode(raw_ostream &, const GenericDebugNode *,
- TypePrinting *, SlotTracker *,
- const Module *) {
- llvm_unreachable("Unimplemented write");
+static void writeGenericDebugNode(raw_ostream &Out, const GenericDebugNode *N,
+ TypePrinting *TypePrinter,
+ SlotTracker *Machine, const Module *Context) {
+ Out << "!GenericDebugNode(";
+ FieldSeparator FS;
+ // Always output the line, since 0 is a relevant and important value for it.
+ Out << FS << "tag: " << N->getTag();
+ if (!N->getHeader().empty()) {
+ Out << FS << "header: \"";
+ PrintEscapedString(N->getHeader(), Out);
+ Out << "\"";
+ }
+ if (N->getNumDwarfOperands()) {
+ Out << FS << "operands: {";
+ FieldSeparator IFS;
+ for (auto &I : N->dwarf_operands()) {
+ Out << IFS;
+ if (!I) {
+ Out << "null";
+ continue;
+ }
+ WriteAsOperandInternal(Out, I, TypePrinter, Machine, Context);
+ }
+ Out << "}";
+ }
+ Out << ")";
}
static void writeMDLocation(raw_ostream &Out, const MDLocation *DL,
OpenPOWER on IntegriCloud