AsmWriter: Extract writeTag(), NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 6 Feb 2015 22:28:05 +0000 (22:28 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 6 Feb 2015 22:28:05 +0000 (22:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228447 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/AsmWriter.cpp

index 8b7ed55fe71f878a7c2c0498e6c44e07fc30fbdd..43ae3feb36390f97dc24ac47716684bc789f8db3 100644 (file)
@@ -1297,16 +1297,20 @@ static void writeMetadataAsOperand(raw_ostream &Out, const Metadata *MD,
   WriteAsOperandInternal(Out, MD, TypePrinter, Machine, Context);
 }
 
-static void writeGenericDebugNode(raw_ostream &Out, const GenericDebugNode *N,
-                                  TypePrinting *TypePrinter,
-                                  SlotTracker *Machine, const Module *Context) {
-  Out << "!GenericDebugNode(";
-  FieldSeparator FS;
+static void writeTag(raw_ostream &Out, FieldSeparator &FS, const DebugNode *N) {
   Out << FS << "tag: ";
   if (const char *Tag = dwarf::TagString(N->getTag()))
     Out << Tag;
   else
     Out << N->getTag();
+}
+
+static void writeGenericDebugNode(raw_ostream &Out, const GenericDebugNode *N,
+                                  TypePrinting *TypePrinter,
+                                  SlotTracker *Machine, const Module *Context) {
+  Out << "!GenericDebugNode(";
+  FieldSeparator FS;
+  writeTag(Out, FS, N);
   if (!N->getHeader().empty()) {
     Out << FS << "header: \"";
     PrintEscapedString(N->getHeader(), Out);