llvm/lib/MC/MCAsmMacro.cpp
Oliver Stannard 193fdf6730 [Asm] Fix another layering violation in assmebly macro dumping
AsmToken is in the MCParser library, so we can't use its dump function from
MCAsmMacro in the MC library. Instead, just print the string, which we don't
need the MCParser library for.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326810 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-06 16:51:17 +00:00

43 lines
1.0 KiB
C++

//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCAsmMacro.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
void MCAsmMacroParameter::dump(raw_ostream &OS) const {
OS << "\"" << Name << "\"";
if (Required)
OS << ":req";
if (Vararg)
OS << ":vararg";
if (!Value.empty()) {
OS << " = ";
bool first = true;
for (const AsmToken &T : Value) {
if (!first)
OS << ", ";
first = false;
OS << T.getString();
}
}
OS << "\n";
}
void MCAsmMacro::dump(raw_ostream &OS) const {
OS << "Macro " << Name << ":\n";
OS << " Parameters:\n";
for (const MCAsmMacroParameter &P : Parameters) {
OS << " ";
P.dump();
}
OS << " (BEGIN BODY)" << Body << "(END BODY)\n";
}