1 //===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "llvm/MC/MCAsmMacro.h" 11 #include "llvm/Support/raw_ostream.h" 12 13 using namespace llvm; 14 dump(raw_ostream & OS) const15void MCAsmMacroParameter::dump(raw_ostream &OS) const { 16 OS << "\"" << Name << "\""; 17 if (Required) 18 OS << ":req"; 19 if (Vararg) 20 OS << ":vararg"; 21 if (!Value.empty()) { 22 OS << " = "; 23 bool first = true; 24 for (const AsmToken &T : Value) { 25 if (!first) 26 OS << ", "; 27 first = false; 28 OS << T.getString(); 29 } 30 } 31 OS << "\n"; 32 } 33 dump(raw_ostream & OS) const34void MCAsmMacro::dump(raw_ostream &OS) const { 35 OS << "Macro " << Name << ":\n"; 36 OS << " Parameters:\n"; 37 for (const MCAsmMacroParameter &P : Parameters) { 38 OS << " "; 39 P.dump(); 40 } 41 OS << " (BEGIN BODY)" << Body << "(END BODY)\n"; 42 } 43