[llvm] r228446 - AsmWriter: Extract writeMetadataAsOperand(), NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Fri Feb 6 14:27:22 PST 2015
Author: dexonsmith
Date: Fri Feb 6 16:27:22 2015
New Revision: 228446
URL: http://llvm.org/viewvc/llvm-project?rev=228446&view=rev
Log:
AsmWriter: Extract writeMetadataAsOperand(), NFC
Modified:
llvm/trunk/lib/IR/AsmWriter.cpp
Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=228446&r1=228445&r2=228446&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Fri Feb 6 16:27:22 2015
@@ -1286,6 +1286,17 @@ raw_ostream &operator<<(raw_ostream &OS,
}
} // 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_os
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 << "}";
}
More information about the llvm-commits
mailing list