summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-06 22:27:22 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-06 22:27:22 +0000
commit61a093300754475909ab376bf01f9dd2fd91b2be (patch)
treeeb93036ea1275f2ec2bc70e9b635339940861ddd /llvm/lib
parent4e12057760c2bd1b1ae96bf15c2b9d4464475ac8 (diff)
downloadbcm5719-llvm-61a093300754475909ab376bf01f9dd2fd91b2be.tar.gz
bcm5719-llvm-61a093300754475909ab376bf01f9dd2fd91b2be.zip
AsmWriter: Extract writeMetadataAsOperand(), NFC
llvm-svn: 228446
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 46f26c579ac..8b7ed55fe71 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1286,6 +1286,17 @@ raw_ostream &operator<<(raw_ostream &OS, FieldSeparator &FS) {
}
} // end namespace
+static void writeMetadataAsOperand(raw_ostream &Out, const Metadata *MD,
+ TypePrinting *TypePrinter,
+ SlotTracker *Machine,
+ const Module *Context) {
+ if (!MD) {
+ Out << "null";
+ return;
+ }
+ WriteAsOperandInternal(Out, MD, TypePrinter, Machine, Context);
+}
+
static void writeGenericDebugNode(raw_ostream &Out, const GenericDebugNode *N,
TypePrinting *TypePrinter,
SlotTracker *Machine, const Module *Context) {
@@ -1306,11 +1317,7 @@ static void writeGenericDebugNode(raw_ostream &Out, const GenericDebugNode *N,
FieldSeparator IFS;
for (auto &I : N->dwarf_operands()) {
Out << IFS;
- if (!I) {
- Out << "null";
- continue;
- }
- WriteAsOperandInternal(Out, I, TypePrinter, Machine, Context);
+ writeMetadataAsOperand(Out, I, TypePrinter, Machine, Context);
}
Out << "}";
}
OpenPOWER on IntegriCloud